|
Hi, samcake,
If there is no cluster attached to a bone in the hierarchy, that means this bone is not used in the binding.
Then you have to calculate its global transform at binding moment by yourself.
Imagine an hierachy: ParentBone->ChildBone, if ParentBone participated in the binding, but ChildBone did not, then there should be a cluster attached to ParentBone, but no any cluster attached to ChildBone.
From the parent cluster you can call “GetTransformLinkMatrix” to get the global transform of ParentBone at binding moment, then you can calculate the global transform of the ChildBone at binding like this:
ChildGlobalAtBinding = ParentGlobalAtBinding * ChildLocal.
I think this is what Nian means in his answer to Q1. It depends on which parent global transform you are using, the default one or the one at binding, then you can get corresponding global transform of Child.
BTW, you can also get global transform at binding from pose nodes of KFbxPose, each pose node are corresponding to the mesh or the binding bones. But if the bone does not participate the binding, I think it won’t have corresponding pose node in the bindpose too.
But in one case, if there is a corrupted FBX file which store the bindpose info of a bone, but lost its cluster, then you can still get its global transform at binding from KFbxPose.
Author: Jiayang Xu
|