Add option for importing scale tracking to animation asset

This commit is contained in:
Wojtek Figat
2023-02-07 09:39:31 +01:00
parent e02c4b6f98
commit 7a2023ead6
6 changed files with 23 additions and 5 deletions

View File

@@ -1051,9 +1051,9 @@ bool ImportAnimation(int32 index, ImportedModelData& data, OpenFbxImporterData&
const ofbx::AnimationCurveNode* translationNode = layer->getCurveNode(*aNode.FbxObj, "Lcl Translation");
const ofbx::AnimationCurveNode* rotationNode = layer->getCurveNode(*aNode.FbxObj, "Lcl Rotation");
const ofbx::AnimationCurveNode* scalingNode = nullptr; //layer->getCurveNode(*aNode.FbxObj, "Lcl Scaling");
const ofbx::AnimationCurveNode* scalingNode = layer->getCurveNode(*aNode.FbxObj, "Lcl Scaling");
if (translationNode || rotationNode || scalingNode)
if (translationNode || rotationNode || (scalingNode && importerData.Options.ImportScaleTracks))
animatedNodes.Add(nodeIndex);
}
if (animatedNodes.IsEmpty())
@@ -1069,13 +1069,14 @@ bool ImportAnimation(int32 index, ImportedModelData& data, OpenFbxImporterData&
const ofbx::AnimationCurveNode* translationNode = layer->getCurveNode(*aNode.FbxObj, "Lcl Translation");
const ofbx::AnimationCurveNode* rotationNode = layer->getCurveNode(*aNode.FbxObj, "Lcl Rotation");
//const ofbx::AnimationCurveNode* scalingNode = layer->getCurveNode(*aNode.FbxObj, "Lcl Scaling");
const ofbx::AnimationCurveNode* scalingNode = layer->getCurveNode(*aNode.FbxObj, "Lcl Scaling");
anim.NodeName = aNode.Name;
ImportCurve(translationNode, anim.Position, info, ExtractKeyframePosition);
ImportCurve(rotationNode, anim.Rotation, info, ExtractKeyframeRotation);
//ImportCurve(scalingNode, anim.Scale, info, ExtractKeyframeScale);
if (importerData.Options.ImportScaleTracks)
ImportCurve(scalingNode, anim.Scale, info, ExtractKeyframeScale);
}
if (importerData.ConvertRH)