Browse Source

Do not skip the assimp scene root, if it has non-identity transform or contains models itself.

Lasse Öörni 10 years ago
parent
commit
e6194640ff
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Source/Tools/AssetImporter/AssetImporter.cpp

+ 4 - 1
Source/Tools/AssetImporter/AssetImporter.cpp

@@ -1367,7 +1367,10 @@ void BuildAndSaveScene(OutScene& scene, bool asPrefab)
     else
     {
         // If not saving as a prefab, associate the root node with the scene first to prevent unnecessary creation of a root
-        nodeMapping[rootNode_] = outScene;
+        // However do not do that if the root node does not have an identity matrix, or itself contains a model
+        // (models at the Urho scene root are not preferable)
+        if (ToMatrix3x4(rootNode_->mTransformation).Equals(Matrix3x4::IDENTITY) && !scene.nodes_.Contains(rootNode_))
+           nodeMapping[rootNode_] = outScene;
     }
 
     // If is allowed to export empty nodes, export the full Assimp node hierarchy first