Browse Source

fixed the texture file path problem, there is still one question, I will ask dave tomorrow

Asad M. Zaman 20 years ago
parent
commit
7573bcfebd
1 changed files with 16 additions and 16 deletions
  1. 16 16
      pandatool/src/mayaprogs/mayaCopy.cxx

+ 16 - 16
pandatool/src/mayaprogs/mayaCopy.cxx

@@ -170,22 +170,6 @@ copy_maya_file(const Filename &source, const Filename &dest,
     return false;
   }
 
-  // Get all the shaders so we can determine the set of textures.
-  _shaders.clear();
-  collect_shaders();
-  int num_shaders = _shaders.get_num_shaders();
-  for (int i = 0; i < num_shaders; i++) {
-    MayaShader *shader = _shaders.get_shader(i);
-    for (size_t j = 0; j < shader->_color.size(); j++) {
-      if (!extract_texture(*shader->get_color_def(j), dir)) {
-        return false;
-      }
-    }
-    if (!extract_texture(shader->_transparency, dir)) {
-      return false;
-    }
-  }
-
   // Get the set of externally referenced Maya files.
   MStringArray refs;
   MStatus status = MFileIO::getReferences(refs);
@@ -231,6 +215,22 @@ copy_maya_file(const Filename &source, const Filename &dest,
     MGlobal::executeCommand(MString(execString.c_str()));
   }
 
+  // Get all the shaders so we can determine the set of textures.
+  _shaders.clear();
+  collect_shaders();
+  int num_shaders = _shaders.get_num_shaders();
+  for (int i = 0; i < num_shaders; i++) {
+    MayaShader *shader = _shaders.get_shader(i);
+    for (size_t j = 0; j < shader->_color.size(); j++) {
+      if (!extract_texture(*shader->get_color_def(j), dir)) {
+        return false;
+      }
+    }
+    if (!extract_texture(shader->_transparency, dir)) {
+      return false;
+    }
+  }
+
   // Now write out the Maya file.
   if (!_maya->write(dest)) {
     maya_cat.error()