Browse Source

Code cleanup, renamed command line option. Updated AssetImporter documentation.

Lasse Öörni 11 years ago
parent
commit
5b4da41b10
4 changed files with 17 additions and 12 deletions
  1. 1 0
      Docs/Reference.dox
  2. 1 0
      Docs/Urho3D.dox
  3. 1 0
      Readme.txt
  4. 14 12
      Source/Tools/AssetImporter/AssetImporter.cpp

+ 1 - 0
Docs/Reference.dox

@@ -1990,6 +1990,7 @@ Options:
 -cm         Check and do not overwrite if material exists
 -ct         Check and do not overwrite if texture exists
 -ctn        Check and do not overwrite if texture has newer timestamp
+-am         Export all meshes even if identical (scene mode only)
 \endverbatim
 
 The material list is a text file, one material per line, saved alongside the Urho3D model. It is used by the scene editor to automatically apply the imported default materials when setting a new model for a StaticModel, StaticModelGroup, AnimatedModel or Skybox component, and can also be manually invoked by calling \ref StaticModel::ApplyMaterialList "ApplyMaterialList()". The list files can safely be deleted if not needed.

+ 1 - 0
Docs/Urho3D.dox

@@ -91,6 +91,7 @@ Urho3D development, contributions and bugfixes by:
 - OvermindDL1
 - andmar1x
 - amadeus_osa
+- atship
 - mightyCelu
 - reattiva
 - skaiware

+ 1 - 0
Readme.txt

@@ -44,6 +44,7 @@ Urho3D development, contributions and bugfixes by:
 - OvermindDL1
 - andmar1x
 - amadeus_osa
+- atship
 - mightyCelu
 - reattiva
 - skaiware

+ 14 - 12
Source/Tools/AssetImporter/AssetImporter.cpp

@@ -115,7 +115,7 @@ bool emissiveAO_ = false;
 bool noOverwriteMaterial_ = false;
 bool noOverwriteTexture_ = false;
 bool noOverwriteNewerTexture_ = false;
-bool noExportTwice4IdenticalMeshes = true;
+bool checkUniqueModel_ = true;
 Vector<String> nonSkinningBoneIncludes_;
 Vector<String> nonSkinningBoneExcludes_;
 
@@ -234,7 +234,7 @@ void Run(const Vector<String>& arguments)
             "-cm         Check and do not overwrite if material exists\n"
             "-ct         Check and do not overwrite if texture exists\n"
             "-ctn        Check and do not overwrite if texture has newer timestamp\n"
-            "-full       Export all meshes even if they are identical with each other (scene mode only)\n"
+            "-am         Export all meshes even if identical (scene mode only)\n"
         );
     }
     
@@ -361,8 +361,8 @@ void Run(const Vector<String>& arguments)
                 noOverwriteTexture_ = true;
             else if (argument == "ctn")
                 noOverwriteNewerTexture_ = true;
-            else if (argument == "full")
-                noExportTwice4IdenticalMeshes = false;
+            else if (argument == "am")
+                checkUniqueModel_ = false;
         }
     }
     
@@ -1189,16 +1189,18 @@ void CollectSceneModels(OutScene& scene, aiNode* node)
         
         // Check if a model with identical mesh indices already exists. If yes, do not export twice
         bool unique = true;
-        if (noExportTwice4IdenticalMeshes)
-        for (unsigned i = 0; i < scene.models_.Size(); ++i)
+        if (checkUniqueModel_)
         {
-            if (scene.models_[i].meshIndices_ == model.meshIndices_)
+            for (unsigned i = 0; i < scene.models_.Size(); ++i)
             {
-                PrintLine("Added node " + FromAIString(node->mName));
-                scene.nodes_.Push(node);
-                scene.nodeModelIndices_.Push(i);
-                unique = false;
-                break;
+                if (scene.models_[i].meshIndices_ == model.meshIndices_)
+                {
+                    PrintLine("Added node " + FromAIString(node->mName));
+                    scene.nodes_.Push(node);
+                    scene.nodeModelIndices_.Push(i);
+                    unique = false;
+                    break;
+                }
             }
         }
         if (unique)