Browse Source

customized node transformation format

ywang 4 years ago
parent
commit
01e61c8b9f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      code/AssetLib/glTF2/glTF2Exporter.cpp

+ 2 - 2
code/AssetLib/glTF2/glTF2Exporter.cpp

@@ -1,4 +1,4 @@
-/*
+/*
 Open Asset Import Library (assimp)
 Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 
 
@@ -1006,7 +1006,7 @@ unsigned int glTF2Exporter::ExportNode(const aiNode* n, Ref<Node>& parent)
     node->name = name;
     node->name = name;
 
 
     if (!n->mTransformation.IsIdentity()) {
     if (!n->mTransformation.IsIdentity()) {
-		if (mScene->mNumAnimations > 0) {
+		if (mScene->mNumAnimations > 0 || (mProperties && mProperties->HasPropertyBool("GLTF2_NODE_IN_TRS"))) {
 			aiQuaternion quaternion;
 			aiQuaternion quaternion;
 			n->mTransformation.Decompose(*reinterpret_cast<aiVector3D *>(&node->scale.value), quaternion, *reinterpret_cast<aiVector3D *>(&node->translation.value));
 			n->mTransformation.Decompose(*reinterpret_cast<aiVector3D *>(&node->scale.value), quaternion, *reinterpret_cast<aiVector3D *>(&node->translation.value));