Browse Source

Ready for advanced texturing

Josh Yelon 17 years ago
parent
commit
6282dfa357

+ 8 - 34
pandatool/src/maxegg/maxToEggConverter.cxx

@@ -39,7 +39,6 @@ MaxToEggConverter::
 //     Function: MaxToEggConverter::reset
 //     Function: MaxToEggConverter::reset
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void MaxToEggConverter::reset() {
 void MaxToEggConverter::reset() {
-    _transform_type = TT_model;
     _cur_tref = 0;
     _cur_tref = 0;
     _current_frame = 0;
     _current_frame = 0;
     _textures.clear();
     _textures.clear();
@@ -849,15 +848,12 @@ set_material_attributes(EggPrimitive &primitive, Mtl *maxMaterial, Face *face) {
     Point3 diffuseColor = Point3(1, 1, 1);
     Point3 diffuseColor = Point3(1, 1, 1);
 
 
     //First, get the material data associated with this node.
     //First, get the material data associated with this node.
-    //  maxMaterial = max_node->GetMtl();
     if ( !maxMaterial ) {
     if ( !maxMaterial ) {
         return;
         return;
     }
     }
 
 
     //Now, determine wether it's a standard or multi material
     //Now, determine wether it's a standard or multi material
     if ( maxMaterial->ClassID() == Class_ID(DMTL_CLASS_ID, 0 )) {
     if ( maxMaterial->ClassID() == Class_ID(DMTL_CLASS_ID, 0 )) {
-        // *** Eventuall we should probably deal with multi-materials
-     
         maxStandardMaterial = (StdMat *)maxMaterial;
         maxStandardMaterial = (StdMat *)maxMaterial;
 
 
         // Access the Diffuse map and see if it's a Bitmap texture
         // Access the Diffuse map and see if it's a Bitmap texture
@@ -1068,27 +1064,6 @@ reparent_decals(EggGroupNode *egg_parent) {
     return okflag;
     return okflag;
 }
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: MayaShader::string_transform_type
-//       Access: Public, Static
-//  Description: Returns the TransformType value corresponding to the
-//               indicated string, or TT_invalid.
-////////////////////////////////////////////////////////////////////
-MaxToEggConverter::TransformType MaxToEggConverter::
-string_transform_type(const string &arg) {
-    if (strcmp(arg.c_str(), "all") == 0) {
-        return TT_all;
-    } else if (strcmp(arg.c_str(), "model") == 0) {
-        return TT_model;
-    } else if (strcmp(arg.c_str(), "dcs") == 0) {
-        return TT_dcs;
-    } else if (strcmp(arg.c_str(), "none") == 0) {
-        return TT_none;
-    } else {
-        return TT_invalid;
-    }
-}
-
 Modifier* MaxToEggConverter::FindSkinModifier (INode* node, const Class_ID &type)
 Modifier* MaxToEggConverter::FindSkinModifier (INode* node, const Class_ID &type)
 {
 {
     // Get object from node. Abort if no object.
     // Get object from node. Abort if no object.
@@ -1101,15 +1076,14 @@ Modifier* MaxToEggConverter::FindSkinModifier (INode* node, const Class_ID &type
         IDerivedObject* pDerObj = static_cast<IDerivedObject*>(pObj);
         IDerivedObject* pDerObj = static_cast<IDerivedObject*>(pObj);
 
 
         // Iterate over all entries of the modifier stack.
         // Iterate over all entries of the modifier stack.
-        for (int stackId = 0; stackId < pDerObj->NumModifiers(); ++stackId)
-            {
-                // Get current modifier.
-                Modifier* mod = pDerObj->GetModifier(stackId);
-
-                // Is this what we are looking for?
-                if (mod->ClassID() == type )
-                    return mod;
-            }
+        for (int stackId = 0; stackId < pDerObj->NumModifiers(); ++stackId) {
+            // Get current modifier.
+            Modifier* mod = pDerObj->GetModifier(stackId);
+            
+            // Is this what we are looking for?
+            if (mod->ClassID() == type )
+                return mod;
+        }
 
 
         // continue with next derived object
         // continue with next derived object
         pObj = pDerObj->GetObjRef();
         pObj = pDerObj->GetObjRef();

+ 1 - 12
pandatool/src/maxegg/maxToEggConverter.h

@@ -51,6 +51,7 @@ class MaxToEggConverter {
     string            _program_name;
     string            _program_name;
     MaxNodeTree       _tree;
     MaxNodeTree       _tree;
     int               _cur_tref;
     int               _cur_tref;
+    EggTextureCollection _textures;
     
     
     void reset();
     void reset();
 
 
@@ -87,19 +88,7 @@ class MaxToEggConverter {
     bool reparent_decals(EggGroupNode *egg_parent);
     bool reparent_decals(EggGroupNode *egg_parent);
     
     
  public:
  public:
-    EggTextureCollection _textures;
     
     
-    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);
     Modifier* FindSkinModifier (INode* node, const Class_ID &type);
 };
 };