EvaluateLocalTransform but based on an FBXAnimLayer

EvaluateLocalTransform but based on an FBXAnimLayer

Anonymous
Not applicable
1,225 Views
1 Reply
Message 1 of 2

EvaluateLocalTransform but based on an FBXAnimLayer

Anonymous
Not applicable

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.

0 Likes
Accepted solutions (1)
1,226 Views
1 Reply
  • FBX
Reply (1)
Message 2 of 2

regalir
Autodesk
Autodesk
Accepted 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.