From 08f2be33ceac6ab47decfbf383645806c966dfcf Mon Sep 17 00:00:00 2001 From: Josh Yelon Date: Tue, 5 Jul 2005 18:42:02 +0000 Subject: [PATCH] Fixing filenames --- .../maxegg/{DllEntry.cpp => maxDllEntry.cxx} | 0 .../src/maxegg/{MaxEgg.cpp => maxEgg.cxx} | 2 +- .../src/maxegg/{MaxEgg.def => maxEgg.def} | 0 pandatool/src/maxegg/{MaxEgg.h => maxEgg.h} | 6 +- .../src/maxegg/{MaxEgg.obj => maxEgg.obj} | Bin pandatool/src/maxegg/{MaxEgg.rc => maxEgg.rc} | 2 +- .../src/maxegg/{MaxEgg.res => maxEgg.res} | Bin ...EggExpOptions.cpp => maxEggExpOptions.cxx} | 6 +- ...{MaxEggExpOptions.h => maxEggExpOptions.h} | 8 +- .../src/maxegg/{Logger.cpp => maxLogger.cxx} | 2 +- .../src/maxegg/{Logger.h => maxLogger.h} | 6 +- pandatool/src/maxegg/maxNodeDesc.cxx | 2 +- pandatool/src/maxegg/maxNodeDesc.h | 4 +- pandatool/src/maxegg/maxNodeTree.cxx | 4 +- .../src/maxegg/{resource.h => maxResource.h} | 0 .../src/maxegg/{MaxToEgg.cpp => maxToEgg.cxx} | 4 +- .../src/maxegg/{MaxToEgg.h => maxToEgg.h} | 10 +- pandatool/src/maxegg/maxToEggConverter.h | 203 ++++++++++++++++++ ...{post_max_include.h => max_post_include.h} | 0 .../{pre_max_include.h => max_pre_include.h} | 0 pandatool/src/maxegg/maxegg_composite1.cxx | 14 +- 21 files changed, 238 insertions(+), 35 deletions(-) rename pandatool/src/maxegg/{DllEntry.cpp => maxDllEntry.cxx} (100%) rename pandatool/src/maxegg/{MaxEgg.cpp => maxEgg.cxx} (99%) rename pandatool/src/maxegg/{MaxEgg.def => maxEgg.def} (100%) rename pandatool/src/maxegg/{MaxEgg.h => maxEgg.h} (97%) rename pandatool/src/maxegg/{MaxEgg.obj => maxEgg.obj} (100%) rename pandatool/src/maxegg/{MaxEgg.rc => maxEgg.rc} (96%) rename pandatool/src/maxegg/{MaxEgg.res => maxEgg.res} (100%) rename pandatool/src/maxegg/{MaxEggExpOptions.cpp => maxEggExpOptions.cxx} (99%) rename pandatool/src/maxegg/{MaxEggExpOptions.h => maxEggExpOptions.h} (96%) rename pandatool/src/maxegg/{Logger.cpp => maxLogger.cxx} (99%) rename pandatool/src/maxegg/{Logger.h => maxLogger.h} (98%) rename pandatool/src/maxegg/{resource.h => maxResource.h} (100%) rename pandatool/src/maxegg/{MaxToEgg.cpp => maxToEgg.cxx} (99%) rename pandatool/src/maxegg/{MaxToEgg.h => maxToEgg.h} (94%) create mode 100755 pandatool/src/maxegg/maxToEggConverter.h rename pandatool/src/maxegg/{post_max_include.h => max_post_include.h} (100%) rename pandatool/src/maxegg/{pre_max_include.h => max_pre_include.h} (100%) diff --git a/pandatool/src/maxegg/DllEntry.cpp b/pandatool/src/maxegg/maxDllEntry.cxx similarity index 100% rename from pandatool/src/maxegg/DllEntry.cpp rename to pandatool/src/maxegg/maxDllEntry.cxx diff --git a/pandatool/src/maxegg/MaxEgg.cpp b/pandatool/src/maxegg/maxEgg.cxx similarity index 99% rename from pandatool/src/maxegg/MaxEgg.cpp rename to pandatool/src/maxegg/maxEgg.cxx index 9e82fda49b..0f80ffd3d7 100755 --- a/pandatool/src/maxegg/MaxEgg.cpp +++ b/pandatool/src/maxegg/maxEgg.cxx @@ -9,7 +9,7 @@ */ //Includes & Defines -#include "MaxEgg.h" +#include "maxEgg.h" //Types and structures from windows system-level calls #include #include diff --git a/pandatool/src/maxegg/MaxEgg.def b/pandatool/src/maxegg/maxEgg.def similarity index 100% rename from pandatool/src/maxegg/MaxEgg.def rename to pandatool/src/maxegg/maxEgg.def diff --git a/pandatool/src/maxegg/MaxEgg.h b/pandatool/src/maxegg/maxEgg.h similarity index 97% rename from pandatool/src/maxegg/MaxEgg.h rename to pandatool/src/maxegg/maxEgg.h index 1169ba5edc..cbf4ad1b50 100755 --- a/pandatool/src/maxegg/MaxEgg.h +++ b/pandatool/src/maxegg/maxEgg.h @@ -18,13 +18,13 @@ #include "pandatoolbase.h" //Includes & Definitions -#include "MaxToEgg.h" -#include "MaxEggExpOptions.h" +#include "maxToEgg.h" +#include "maxEggExpOptions.h" #include "windef.h" /* Error-Reporting Includes */ -#include "Logger.h" +#include "maxLogger.h" #define ME Logger::ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM6 #define MaxEggPlugin_CLASS_ID Class_ID(0x7ac0d6b7, 0x55731ef6) diff --git a/pandatool/src/maxegg/MaxEgg.obj b/pandatool/src/maxegg/maxEgg.obj similarity index 100% rename from pandatool/src/maxegg/MaxEgg.obj rename to pandatool/src/maxegg/maxEgg.obj diff --git a/pandatool/src/maxegg/MaxEgg.rc b/pandatool/src/maxegg/maxEgg.rc similarity index 96% rename from pandatool/src/maxegg/MaxEgg.rc rename to pandatool/src/maxegg/maxEgg.rc index 18f8fc1443..595a666bde 100755 --- a/pandatool/src/maxegg/MaxEgg.rc +++ b/pandatool/src/maxegg/maxEgg.rc @@ -1,6 +1,6 @@ // Microsoft Visual C++ generated resource script. // -#include "resource.h" +#include "maxResource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// diff --git a/pandatool/src/maxegg/MaxEgg.res b/pandatool/src/maxegg/maxEgg.res similarity index 100% rename from pandatool/src/maxegg/MaxEgg.res rename to pandatool/src/maxegg/maxEgg.res diff --git a/pandatool/src/maxegg/MaxEggExpOptions.cpp b/pandatool/src/maxegg/maxEggExpOptions.cxx similarity index 99% rename from pandatool/src/maxegg/MaxEggExpOptions.cpp rename to pandatool/src/maxegg/maxEggExpOptions.cxx index f1d26815cd..3d9ea20ab7 100755 --- a/pandatool/src/maxegg/MaxEggExpOptions.cpp +++ b/pandatool/src/maxegg/maxEggExpOptions.cxx @@ -1,5 +1,5 @@ /* - MaxEgg.cpp + maxEggExpOptions.cxx Created by Phillip Saltzman, 2/15/05 Carnegie Mellon University, Entetainment Technology Center @@ -7,7 +7,7 @@ what to export from 3D Studio max */ -#include "MaxEggExpOptions.h" +#include "maxEggExpOptions.h" //Disable the forcing int to true or false performance warning #pragma warning(disable: 4800) @@ -765,4 +765,4 @@ bool MaxEggExpOptions::DoExport(IObjParam *ip, bool autoOverwrite, bool saveLog) delete Logger::globalLoggingInstance; return successful; -} \ No newline at end of file +} diff --git a/pandatool/src/maxegg/MaxEggExpOptions.h b/pandatool/src/maxegg/maxEggExpOptions.h similarity index 96% rename from pandatool/src/maxegg/MaxEggExpOptions.h rename to pandatool/src/maxegg/maxEggExpOptions.h index f739c028a4..ca1cceb613 100755 --- a/pandatool/src/maxegg/MaxEggExpOptions.h +++ b/pandatool/src/maxegg/maxEggExpOptions.h @@ -1,5 +1,5 @@ /* - MaxEggExpOptions.h + maxEggExpOptions.h Created by Phillip Saltzman, 2/15/05 Carnegie Mellon University, Entetainment Technology Center @@ -7,8 +7,8 @@ export options, and then execute the export */ -#ifndef __MaxEggExpOptions__H -#define __MaxEggExpOptions__H +#ifndef __maxEggExpOptions__H +#define __maxEggExpOptions__H #pragma conform(forScope, off) @@ -17,7 +17,7 @@ #include "windef.h" /* Error-Reporting Includes */ -#include "Logger.h" +#include "maxLogger.h" #define ME Logger::ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM6 #define MNEG Logger::ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM2 #define MNEG_GEOMETRY_GENERATION Logger::ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM3 diff --git a/pandatool/src/maxegg/Logger.cpp b/pandatool/src/maxegg/maxLogger.cxx similarity index 99% rename from pandatool/src/maxegg/Logger.cpp rename to pandatool/src/maxegg/maxLogger.cxx index 9724881ea2..ef5eb68896 100755 --- a/pandatool/src/maxegg/Logger.cpp +++ b/pandatool/src/maxegg/maxLogger.cxx @@ -1,4 +1,4 @@ -#include "Logger.h" +#include "maxLogger.h" /* Globals & Static Members */ diff --git a/pandatool/src/maxegg/Logger.h b/pandatool/src/maxegg/maxLogger.h similarity index 98% rename from pandatool/src/maxegg/Logger.h rename to pandatool/src/maxegg/maxLogger.h index 2e497d3ab2..24008ea57c 100755 --- a/pandatool/src/maxegg/Logger.h +++ b/pandatool/src/maxegg/maxLogger.h @@ -1,5 +1,5 @@ -#ifndef __Kens_Logger__H -#define __Kens_Logger__H +#ifndef __maxLogger__H +#define __maxLogger__H /* Standard C++ Includes for file and stream output */ @@ -118,4 +118,4 @@ private: /* Externed Globals */ -#endif \ No newline at end of file +#endif diff --git a/pandatool/src/maxegg/maxNodeDesc.cxx b/pandatool/src/maxegg/maxNodeDesc.cxx index c4417d9a03..90b929b33a 100755 --- a/pandatool/src/maxegg/maxNodeDesc.cxx +++ b/pandatool/src/maxegg/maxNodeDesc.cxx @@ -18,7 +18,7 @@ //////////////////////////////////////////////////////////////////// #include "maxNodeDesc.h" -#include "Logger.h" +#include "maxLogger.h" #define MTEC Logger::ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM4 TypeHandle MaxNodeDesc::_type_handle; diff --git a/pandatool/src/maxegg/maxNodeDesc.h b/pandatool/src/maxegg/maxNodeDesc.h index f188d09b31..02f0925997 100755 --- a/pandatool/src/maxegg/maxNodeDesc.h +++ b/pandatool/src/maxegg/maxNodeDesc.h @@ -32,12 +32,12 @@ //Disable the "Too many actual parameters in istdplug.h" warning in Max5 #pragma warning(push) #pragma warning(disable: 4002) -#include "pre_max_include.h" +#include "max_pre_include.h" #endif #include #include "bipexp.h" #ifdef MAX5 -#include "post_max_include.h" +#include "max_post_include.h" #pragma warning(pop) #endif diff --git a/pandatool/src/maxegg/maxNodeTree.cxx b/pandatool/src/maxegg/maxNodeTree.cxx index 9f02d5961e..ce1eae0664 100755 --- a/pandatool/src/maxegg/maxNodeTree.cxx +++ b/pandatool/src/maxegg/maxNodeTree.cxx @@ -27,11 +27,11 @@ //Disable the "Too many actual parameters in istdplug.h" warning in Max5 #pragma warning(push) #pragma warning(disable: 4002) -#include "pre_max_include.h" +#include "max_pre_include.h" #endif #include "Max.h" #ifdef MAX5 -#include "post_max_include.h" +#include "max_post_include.h" #pragma warning(pop) #endif #include "maxToEggConverter.h" diff --git a/pandatool/src/maxegg/resource.h b/pandatool/src/maxegg/maxResource.h similarity index 100% rename from pandatool/src/maxegg/resource.h rename to pandatool/src/maxegg/maxResource.h diff --git a/pandatool/src/maxegg/MaxToEgg.cpp b/pandatool/src/maxegg/maxToEgg.cxx similarity index 99% rename from pandatool/src/maxegg/MaxToEgg.cpp rename to pandatool/src/maxegg/maxToEgg.cxx index 919ce3d2fc..a2271ea351 100755 --- a/pandatool/src/maxegg/MaxToEgg.cpp +++ b/pandatool/src/maxegg/maxToEgg.cxx @@ -1,12 +1,12 @@ /* - MaxToEgg.cpp + maxToEgg.cxx Created by Ken Strickland 02/24/03 Modified and maintained by Corey Revilla, (05/22/03)-(Present) Carnegie Mellon University, Entetainment Technology Center */ //Our headers, which in turn includes some Max headers. -#include "MaxToEgg.h" +#include "maxToEgg.h" //Member Function Definitions /* ~MaxToEgg() - Uninteresting destructor. diff --git a/pandatool/src/maxegg/MaxToEgg.h b/pandatool/src/maxegg/maxToEgg.h similarity index 94% rename from pandatool/src/maxegg/MaxToEgg.h rename to pandatool/src/maxegg/maxToEgg.h index e2ea28af68..1f89e4a7a6 100755 --- a/pandatool/src/maxegg/MaxToEgg.h +++ b/pandatool/src/maxegg/maxToEgg.h @@ -1,5 +1,5 @@ /* - MaxToEgg.h + maxToEgg.h Created by Ken Strickland, 02/24/03 Modified + Maintained by Corey Revilla, (05/22/03-Present) CMU's Entertainment Technology Center @@ -12,18 +12,18 @@ class, MaxEggPlugin. This class, in turn, is a wrapper about the MaxToEggConverter class, which actually twiddles the bits, as they say. */ -#ifndef __MaxToEgg__H -#define __MaxToEgg__H +#ifndef __maxToEgg__H +#define __maxToEgg__H #pragma conform(forScope, off) #include "pandatoolbase.h" -#include "MaxToEggConverter.h" +#include "maxToEggConverter.h" /* Error-Reporting Includes */ -#include "Logger.h" +#include "maxLogger.h" #define MTE Logger::ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM5 /** diff --git a/pandatool/src/maxegg/maxToEggConverter.h b/pandatool/src/maxegg/maxToEggConverter.h new file mode 100755 index 0000000000..70824f6164 --- /dev/null +++ b/pandatool/src/maxegg/maxToEggConverter.h @@ -0,0 +1,203 @@ +// Filename: maxToEggConverter.h +// Created by Corey Revilla and Ken Strickland (6/22/03) +// from mayaToEggConverter.cxx created by drose (10Nov99) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved +// +// All use of this software is subject to the terms of the Panda 3d +// Software license. You should have received a copy of this license +// along with this source code; you will also find a current copy of +// the license at http://www.panda3d.org/license.txt . +// +// To contact the maintainers of this program write to +// panda3d@yahoogroups.com . +// +//////////////////////////////////////////////////////////////////// + +#ifndef __maxToEggConverter__H +#define __maxToEggConverter__H + +#pragma conform(forScope, off) + +#include "pandatoolbase.h" + +/* 3ds Max Includes, with bonus(!) memory protection + */ + +#ifdef MAX5 +//Disable the "Too many actual parameters in istdplug.h" warning in Max5 +#pragma warning(push) +#pragma warning(disable: 4002) +#include "max_pre_include.h" +#endif +#include "Max.h" +#include "iparamb2.h" +#include "iparamm2.h" +#include "istdplug.h" +#include "iskin.h" +#include "maxResource.h" +#include "stdmat.h" +#include "phyexp.h" +#include "surf_api.h" +#ifdef MAX5 +#include "max_post_include.h" +#pragma warning(pop) +#endif + + +/* Panda Includes + */ +#include "eggCoordinateSystem.h" +#include "eggGroup.h" +#include "eggPolygon.h" +#include "eggTextureCollection.h" +#include "eggTexture.h" +#include "eggVertex.h" +#include "eggVertexPool.h" +#include "eggNurbsCurve.h" +#include "pandatoolbase.h" +#include "somethingToEgg.h" +#include "somethingToEggConverter.h" +#include "eggXfmSAnim.h" + +/* Local Includes + */ +#include "maxNodeTree.h" + +/* Error-Reporting Includes + */ +#include "maxLogger.h" +#define MTEC Logger::ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM4 + +/* Helpful Defintions and Casts + */ +#define null 0 +#define PHYSIQUE_CLASSID Class_ID(PHYSIQUE_CLASS_ID_A, PHYSIQUE_CLASS_ID_B) + +/* External Helper Functions for UI + */ +// *** Figure out why this is causing link errors +//DWORD WINAPI ProgressBarFunction(LPVOID arg); + +//////////////////////////////////////////////////////////////////// +// Class : MaxToEggConverter +// Description : This class supervises the construction of an EggData +// structure from a Max model +//////////////////////////////////////////////////////////////////// +class MaxToEggConverter : public SomethingToEggConverter { + public: + MaxToEggConverter(const string &program_name = ""); + MaxToEggConverter(const MaxToEggConverter ©); + virtual ~MaxToEggConverter(); + + virtual SomethingToEggConverter *make_copy(); + + virtual string get_name() const; + virtual string get_extension() const; + + virtual bool convert_file(const Filename &filename); + bool convert_max(bool from_selection); + + //Sets the interface to 3dsMax. + void setMaxInterface(Interface *pInterface); + + void set_selection_list(ULONG *list, int len) { + _selection_list = list; _selection_len = len; } + void set_double_sided(bool flag) {double_sided = flag;} + + private: + double _current_frame; + ULONG *_selection_list; int _selection_len; + + bool convert_flip(double start_frame, double end_frame, + double frame_inc, double output_frame_rate); + + bool convert_char_model(); + bool convert_char_chan(double start_frame, double end_frame, + double frame_inc, double output_frame_rate); + bool convert_hierarchy(EggGroupNode *egg_root); + bool process_model_node(MaxNodeDesc *node_desc); + + void get_transform(INode *max_node, EggGroup *egg_group); + LMatrix4d get_object_transform(INode *max_node); + void get_joint_transform(INode *max_node, EggGroup *egg_group); + void get_joint_transform(INode *max_node, INode *parent_node, + EggGroup *egg_group); + + // *** Leaving out these functions til there use/support in Max is determined + /* + void make_nurbs_surface(const MDagPath &dag_path, + MFnNurbsSurface &surface, + EggGroup *group); + EggNurbsCurve *make_trim_curve(const MFnNurbsCurve &curve, + const string &nurbs_name, + EggGroupNode *egg_group, + int trim_curve_index); + */ + bool make_nurbs_curve(NURBSCVCurve *curve, const string &name, + TimeValue time, EggGroup *egg_group); + void make_polyset(INode *max_node, + Mesh *mesh, + EggGroup *egg_group, + Shader *default_shader = NULL); + /* + void make_locator(const MDagPath &dag_path, const MFnDagNode &dag_node, + EggGroup *egg_group); + */ + + //Gets the vertex normal for a given face and vertex. Go figure. + Point3 get_max_vertex_normal(Mesh *mesh, int faceNo, int vertNo); + + void get_vertex_weights(INode *max_node, EggVertexPool *vpool); + /* + void set_shader_attributes(EggPrimitive &primitive, + const MayaShader &shader); + */ + void set_material_attributes(EggPrimitive &primitive, INode *max_node); + + void set_material_attributes(EggPrimitive &primitive, Mtl *maxMaterial, Face *face); + + void apply_texture_properties(EggTexture &tex, + StdMat *maxMaterial); + /* + bool compare_texture_properties(EggTexture &tex, + const MayaShaderColorDef &color_def); + */ + + bool reparent_decals(EggGroupNode *egg_parent); + + string _program_name; + bool _from_selection; + + MaxNodeTree _tree; + + int _cur_tref; + bool double_sided; + + public: + //MayaShaders _shaders; + EggTextureCollection _textures; + Interface *maxInterface; + + bool _polygon_output; + double _polygon_tolerance; + + enum TransformType { + TT_invalid, + TT_all, + TT_model, + TT_dcs, + TT_none, + }; + TransformType _transform_type; + + static TransformType string_transform_type(const string &arg); + + Modifier* FindSkinModifier (INode* node, const Class_ID &type); +}; + + +#endif diff --git a/pandatool/src/maxegg/post_max_include.h b/pandatool/src/maxegg/max_post_include.h similarity index 100% rename from pandatool/src/maxegg/post_max_include.h rename to pandatool/src/maxegg/max_post_include.h diff --git a/pandatool/src/maxegg/pre_max_include.h b/pandatool/src/maxegg/max_pre_include.h similarity index 100% rename from pandatool/src/maxegg/pre_max_include.h rename to pandatool/src/maxegg/max_pre_include.h diff --git a/pandatool/src/maxegg/maxegg_composite1.cxx b/pandatool/src/maxegg/maxegg_composite1.cxx index 39bff40f84..1ea676e0be 100755 --- a/pandatool/src/maxegg/maxegg_composite1.cxx +++ b/pandatool/src/maxegg/maxegg_composite1.cxx @@ -1,8 +1,8 @@ -#include "DllEntry.cpp" -#include "Logger.cpp" -#include "MaxEgg.cpp" -#include "MaxEggExpOptions.cpp" +#include "maxDllEntry.cxx" +#include "maxLogger.cxx" +#include "maxEgg.cxx" +#include "maxEggExpOptions.cxx" #include "maxNodeDesc.cxx" -#include "MaxNodeTree.cxx" -#include "MaxToEgg.cpp" -#include "MaxToEggConverter.cxx" +#include "maxNodeTree.cxx" +#include "maxToEgg.cxx" +#include "maxToEggConverter.cxx"