Browse Source

Merge pull request #3075 from aimoonchen/fix_FBX_no_preservePivots_bug

fix FBX no preservePivots bug
Kim Kulling 5 years ago
parent
commit
16725cc3f6
1 changed files with 5 additions and 4 deletions
  1. 5 4
      code/FBX/FBXConverter.cpp

+ 5 - 4
code/FBX/FBXConverter.cpp

@@ -856,13 +856,14 @@ bool FBXConverter::GenerateTransformationNodeChain(const Model &model, const std
 
 
     // name passed to the method is already unique
     // name passed to the method is already unique
     nd->mName.Set(name);
     nd->mName.Set(name);
-
-    for (const auto &transform : chain) {
-        nd->mTransformation = nd->mTransformation * transform;
+    // for (const auto &transform : chain) {
+    // skip inverse chain for no preservePivots
+    for (unsigned int i = TransformationComp_Translation; i < TransformationComp_MAXIMUM; i++) {
+      nd->mTransformation = nd->mTransformation * chain[i];
     }
     }
     return false;
     return false;
 }
 }
-
+  
 void FBXConverter::SetupNodeMetadata(const Model &model, aiNode &nd) {
 void FBXConverter::SetupNodeMetadata(const Model &model, aiNode &nd) {
     const PropertyTable &props = model.Props();
     const PropertyTable &props = model.Props();
     DirectPropertyMap unparsedProperties = props.GetUnparsedProperties();
     DirectPropertyMap unparsedProperties = props.GetUnparsedProperties();