Explorar el Código

Fix to bug where asset database would always try to import certain models (it was failing on creating the .mdl file each time, then next time checking for the .mdl, not finding it, and retrying).

(cherry picked from commit 8d3ef9eeee1a2de0c551de6002017ef679398a87)

(cherry picked from commit 8d3ef9eeee1a2de0c551de6002017ef679398a87)
Gareth Fouche hace 9 años
padre
commit
26ff176b2c
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      Source/ToolCore/Import/OpenAssetImporter.cpp

+ 2 - 2
Source/ToolCore/Import/OpenAssetImporter.cpp

@@ -308,7 +308,7 @@ bool OpenAssetImporter::BuildAndSaveModel(OutModel& model)
     }
 
     String rootNodeName = FromAIString(model.rootNode_->mName);
-    if (!model.meshes_.Size())
+    if (!model.meshes_.Size() && !includeNonSkinningBones_)
     {
         errorMessage_ = "No geometries found starting from node " + rootNodeName;
         return false;
@@ -324,7 +324,7 @@ bool OpenAssetImporter::BuildAndSaveModel(OutModel& model)
 
     bool combineBuffers = true;
     // Check if buffers can be combined (same vertex element mask, under 65535 vertices)
-    unsigned elementMask = GetElementMask(model.meshes_[0]);
+    unsigned elementMask = (model.meshes_.Size() > 0) ? GetElementMask(model.meshes_[0]) : 0;
     for (unsigned i = 0; i < model.meshes_.Size(); ++i)
     {
         if (GetNumValidFaces(model.meshes_[i]))