Community
FBX Forum
Welcome to Autodesk’s FBX Forums. Share your knowledge, ask questions, and explore popular FBX topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

EvaluateLocalTransform but based on an FBXAnimLayer

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Anonymous
979 Views, 1 Reply

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

EvaluateLocalTransform but based on an FBXAnimLayer

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.

Labels (1)
  • FBX
1 REPLY 1
Message 2 of 2
regalir
in reply to: Anonymous

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.

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.

Post to forums  

Autodesk Design & Make Report