Преглед на файлове

Better handling of -omittex:
-- now don't even try to load the shaders, in addition to not copying the textures

Chris Brunner преди 14 години
родител
ревизия
f967af05e2
променени са 1 файла, в които са добавени 12 реда и са изтрити 10 реда
  1. 12 10
      pandatool/src/mayaprogs/mayaCopy.cxx

+ 12 - 10
pandatool/src/mayaprogs/mayaCopy.cxx

@@ -268,15 +268,17 @@ copy_maya_file(const Filename &source, const Filename &dest,
     _curr_idx++;
   }
 
-  // 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->_all_maps.size(); j++) {
-      if (!extract_texture(*shader->_all_maps[j], dir)) {
-        return false;
+  if (!_omit_tex) {
+    // 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->_all_maps.size(); j++) {
+        if (!extract_texture(*shader->_all_maps[j], dir)) {
+          return false;
+        }
       }
     }
   }
@@ -329,7 +331,7 @@ copy_maya_file(const Filename &source, const Filename &dest,
 ////////////////////////////////////////////////////////////////////
 bool MayaCopy::
 extract_texture(MayaShaderColorDef &color_def, CVSSourceDirectory *dir) {
-  Filename texture_filename = 
+  Filename texture_filename =
     _path_replace->convert_path(color_def._texture_filename);
   if (!texture_filename.exists()) {
     nout << "*** Error: texture " << texture_filename