Ver Fonte

minor refinements to maya loader

David Rose há 24 anos atrás
pai
commit
c23f502cd3

+ 0 - 1
pandatool/src/mayaegg/mayaApi.cxx

@@ -141,7 +141,6 @@ read(const Filename &filename) {
     stat.perror(filename.c_str());
     stat.perror(filename.c_str());
     return false;
     return false;
   }
   }
-  mayaegg_cat.info() << "done.\n";
   return true;
   return true;
 }
 }
 
 

+ 5 - 1
pandatool/src/mayaegg/mayaShader.cxx

@@ -230,7 +230,11 @@ read_surface_shader(MObject shader) {
 void MayaShader::
 void MayaShader::
 read_surface_color(MObject color) {
 read_surface_color(MObject color) {
   if (color.hasFn(MFn::kFileTexture)) {
   if (color.hasFn(MFn::kFileTexture)) {
-    _has_texture = get_string_attribute(color, "fileTextureName", _texture);
+    string filename;
+    _has_texture = get_string_attribute(color, "fileTextureName", filename);
+    if (_has_texture) {
+      _texture = Filename::from_os_specific(filename);
+    }
 
 
     get_vec2f_attribute(color, "coverage", _coverage);
     get_vec2f_attribute(color, "coverage", _coverage);
     get_vec2f_attribute(color, "translateFrame", _translate_frame);
     get_vec2f_attribute(color, "translateFrame", _translate_frame);

+ 1 - 1
pandatool/src/mayaegg/mayaShader.h

@@ -50,7 +50,7 @@ public:
   double _transparency;
   double _transparency;
 
 
   bool _has_texture;
   bool _has_texture;
-  string _texture;
+  Filename _texture;
 
 
   LVector2f _coverage;
   LVector2f _coverage;
   LVector2f _translate_frame;
   LVector2f _translate_frame;

+ 8 - 6
pandatool/src/mayaegg/mayaToEggConverter.cxx

@@ -164,6 +164,10 @@ convert_file(const Filename &filename) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool MayaToEggConverter::
 bool MayaToEggConverter::
 convert_maya() {
 convert_maya() {
+  if (_egg_data->get_coordinate_system() == CS_default) {
+    _egg_data->set_coordinate_system(_maya->get_coordinate_system());
+  }
+
   MStatus status;
   MStatus status;
 
 
   MItDag dag_iterator(MItDag::kDepthFirst, MFn::kTransform, &status);
   MItDag dag_iterator(MItDag::kDepthFirst, MFn::kTransform, &status);
@@ -172,10 +176,8 @@ convert_maya() {
     return false;
     return false;
   }
   }
 
 
-  if (mayaegg_cat.is_debug()) {
-    mayaegg_cat.debug()
-      << "Traversing scene graph.\n";
-  }
+  mayaegg_cat.info()
+    << "Converting from Maya.\n";
 
 
   // This while loop walks through the entire Maya hierarchy, one node
   // This while loop walks through the entire Maya hierarchy, one node
   // at a time.  Maya's MItDag object automatically performs a
   // at a time.  Maya's MItDag object automatically performs a
@@ -197,10 +199,10 @@ convert_maya() {
 
 
   if (all_ok) {
   if (all_ok) {
     mayaegg_cat.info()
     mayaegg_cat.info()
-      << "\nDone, no errors.\n";
+      << "Converted, no errors.\n";
   } else {
   } else {
     mayaegg_cat.info()
     mayaegg_cat.info()
-      << "\nDone, errors encountered.\n";
+      << "Errors encountered in conversion.\n";
   }
   }
 
 
   return all_ok;
   return all_ok;

+ 0 - 1
pandatool/src/mayaprogs/mayaToEgg.h

@@ -29,7 +29,6 @@
 class MayaToEgg : public SomethingToEgg {
 class MayaToEgg : public SomethingToEgg {
 public:
 public:
   MayaToEgg();
   MayaToEgg();
-  ~MayaToEgg();
 
 
   void run();
   void run();