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: 

Skeleton Root Bone Animation

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
998 Views, 0 Replies

Skeleton Root Bone Animation

Hey everyone, I’m a long time lurker. I'm using FBX SDK version 7.5.0 to read an FBX file version 7.4.0.

My goal is to convert animations from Mixamo into ThreeJS-compatible JSON files using the FBX SDK. While it’s technically possible to manually use the Blender exporter, I need an automated solution.

 

I can read the contents of the .fbx (or .dae) and navigate the hierarchy. That’s the good news.

 

No matter what I do, I can't seem to get the correct animation rotation data for the root bone. There also seems to be some differences in the skeleton pose.

 

To get the skeleton, I find a (lNode->GetNodeAttribute()->GetAttributeType() == FbxNodeAttribute::eSkeleton) child of the root node in the scene and proceed recursively through it's children one by one doing this:

FbxAMatrix lM = lBone->EvaluateLocalTransform();
FbxDouble3 lT = lM.GetT();
FbxDouble3 lS = lM.GetS();
// FbxDouble3 lR = lM.GetR(); // gives t-pose
FbxVector4 lR = bone->GetPreRotation(FbxNode::eSourcePivot); // gives mesh-pose

 

To get the animation, there seems to be a few options. First I tried…

foreach animation stack/layer, foreach bone, i can:

FbxAnimCurve lRotXCurve = lBone->LclRotation.GetCurve(lAnimLayer, FBXSDK_CURVENODE_COMPONENT_X);
lRotXCurve->KeyGetValue(time);

The root bone node seems to have no rotation data; there are no rotation curves. This process seems to work for all the other bones, for position/rotation/scale.

 

A second approach that I tried was…

foreach bone:

lBone->EvaluateLocalTransform(time)

This seems to produce nothing but the first frame, no matter what value I put in for 'time'.

The first bone does have a rotation, but it's not animated.  I wish this worked, as it's far less cumbersome then the above option.

 

A third approach could be…

foreach bone:

lScene->GetAnimationEvaluator()->GetNodeLocalTranslation(lNode, time, FbxNode::eSourcePivot)

This also seems to produce a non-animating frame, but the skeleton shows up as a contorted monster.

 

To mitigate these issues, I’ve looked at using GetPose() but it's not populated in the FBX, while in the DAE it doesn't have data for all bones.

 

Bonus question: Does anyone know why Mixamo seems to always have a 90 degree rotation and a 0.01 scale for the first root bone?

When I download an FBX or DAE from Mixamo and access with the SDK, they seem to have fairly significantly different structural layouts.

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report