I have an FBX file with a lot of skeletal animations in it, and I needed to be able to get local transforms for each node to use in my game engine.
However, FbxNode::EvaluateLocalTransform seems to not have any arguments that allow you to specify which animation layer you're trying to get the transform for - what do I have to do to get the matrix from EvaluateLocalTransform manually?
I seem to be able to get translation/rotation/scaling values by time for an animation layer with something like "node->LclRotation.GetCurve(animlayer, FBXSDK_CURVENODE_COMPONENT_Z);" but I have no idea how to convert those to the results that EvaluateLocalTransform would give..
Please help me, I am pulling my hair out over this.
Solved! Go to Solution.
I have an FBX file with a lot of skeletal animations in it, and I needed to be able to get local transforms for each node to use in my game engine.
However, FbxNode::EvaluateLocalTransform seems to not have any arguments that allow you to specify which animation layer you're trying to get the transform for - what do I have to do to get the matrix from EvaluateLocalTransform manually?
I seem to be able to get translation/rotation/scaling values by time for an animation layer with something like "node->LclRotation.GetCurve(animlayer, FBXSDK_CURVENODE_COMPONENT_Z);" but I have no idea how to convert those to the results that EvaluateLocalTransform would give..
Please help me, I am pulling my hair out over this.
Solved! Go to Solution.
Solved by regalir. Go to Solution.
The EvaluateLocalTransform will use all the AnimLayers defined for the current AninStack. The AnimationLayers are like Photoshop layers, they are used to "blend" different animations curves to produce a final one.
Each animLayer can be muted so, I guess, you could mute all the AnimLayers except the one you are interested in and evaluate as normal. The code may look like this:
lScene->SetCurrentAnimationStack(lStackOfInterest);
for (int i=0; i < lStackOfInterest->GetMemberCount(); i++)
{
FbxAnimLayer* layer = FbxCast<FbxAnimLayer>(lStackOfInterest->GetMember(i);
if (layer)
layer->Mute.Set(true);
}
Alternatively, to encapsulate this even more, you can consider implementing your own Evaluator and replace the default one.
The EvaluateLocalTransform will use all the AnimLayers defined for the current AninStack. The AnimationLayers are like Photoshop layers, they are used to "blend" different animations curves to produce a final one.
Each animLayer can be muted so, I guess, you could mute all the AnimLayers except the one you are interested in and evaluate as normal. The code may look like this:
lScene->SetCurrentAnimationStack(lStackOfInterest);
for (int i=0; i < lStackOfInterest->GetMemberCount(); i++)
{
FbxAnimLayer* layer = FbxCast<FbxAnimLayer>(lStackOfInterest->GetMember(i);
if (layer)
layer->Mute.Set(true);
}
Alternatively, to encapsulate this even more, you can consider implementing your own Evaluator and replace the default one.
Can't find what you're looking for? Ask the community or share your knowledge.