How to calculate bind pose for bones that are not attached to the skin, but which are in a hierarchy where some bones are attached to the skin

Started by
13 comments, last by Buckshag 9 years, 10 months ago

Hi

I am having problem with calculating bind pose for some bones of a given skeleton using FBX SDK.

I can easily get bind pose matrices for the bones affecting a mesh from the FbxClusters.

I can also calculate bind pose matrices of bones which have no FbxClusters assigned to them if these bones have parent bones which have clusters assigned to them by the method described in the last post here: http://forums.autodesk.com/t5/FBX-SDK/Skeleton-Bind-Pose-for-bones-not-linked-to-clusters/m-p/417362...

Now the problem I am having is how to calculate bind pose matrices for the bones which have no FbxClusters assigned to them and which have either no parent nodes or their parent nodes have no FbxClusters assigned to themselves as well. (Please note that FbxPose has no matrices for these bones either)

In the image below I have outlined examples of such bones in red:

[attachment=22172:pic2.png]

Any help would be highly appreciated.

Thanks

Advertisement

Hi.

I take it that the bones ont getting exported. You say there is no transform??.

Iis it in the fbx file??.

May be you need to see if you can export it correct.

//give it a weight of 0.1 so it not effect the skin and it may work does in .X file

Hi.

I take it that the bones ont getting exported. You say there is no transform??.

Iis it in the fbx file??.

May be you need to see if you can export it correct.

//give it a weight of 0.1 so it not effect the skin and it may work does in .X file

I am not trying to export an FBX file. I already have an FBX file with a model and what I am trying to do is write a converter using FBX SDK which would convert a given FBX file to my own format. The problem is that I am not able to get/compute bind pose for certain bones(the ones described in my first post).

P.S. I know that an FBX file I am dealing with is correct, because Autodesk FBX Viewer displays and animates it correctly.

I would greatly appreciate it if anybody could provide suggestions which could help me to solve this problem.

P.S. I would be more than happy to further explain and/or clarify the problem.

The best way to fix this is assign the bone a small weight then export it again an they will have a transform then. Or you will need to make a transform offset some how. See when you say it works in the viewer there not using them bones.

You can check if there is a bind pose stored in the FBX file.

Calculate the world space matrix based on that pose, and use the inverse of that.

That's what I would try at least. I'm not an FBX expert really so I am not sure if this is the correct solution, but it would make a lot of sense.

If there is no bind pose stored, just try to get the world space matrix and inverse it.

The best way to fix this is assign the bone a small weight then export it again an they will have a transform then. Or you will need to make a transform offset some how. See when you say it works in the viewer there not using them bones.

I have tried this workaround and it looks like it does the job.

You can check if there is a bind pose stored in the FBX file.

Calculate the world space matrix based on that pose, and use the inverse of that.

That's what I would try at least. I'm not an FBX expert really so I am not sure if this is the correct solution, but it would make a lot of sense.

If there is no bind pose stored, just try to get the world space matrix and inverse it.

Unfortunately there is no Pose data available in the FBX file I am dealing with and the global matrices look to be way off the right position.

Thanks

Actually why do you need the bind pose matrix of the bones that do not directly deform any mesh?

Maybe the internals of your engine are not designed to handle this correctly?

I mean as you do not perform skinning using this bone the inverse bind pose matrix is not needed, so it can be skipped/ignored during any calculations if you do not need it for anything else.

I'm pretty sure this is also what the FBX viewer you tried will be doing.

This assuming your bone local transforms in your animation data are stored relative to the parent.

Actually why do you need the bind pose matrix of the bones that do not directly deform any mesh?

Maybe the internals of your engine are not designed to handle this correctly?

I mean as you do not perform skinning using this bone the inverse bind pose matrix is not needed, so it can be skipped/ignored during any calculations if you do not need it for anything else.

I'm pretty sure this is also what the FBX viewer you tried will be doing.

This assuming your bone local transforms in your animation data are stored relative to the parent.

I would like to store a skeleton hierarchy in local space(i.e. each bone relative to its parent). Since FBX only provides bind pose in world space matrices I need these matrices for every bone in order to calculate local space matrices myself.

Can I ask you why you need this local space hierarchy in bind pose? You won't need it to play back an animation at least. It is possible you need it for retargeting, but I assume here you are not needing that right now.

So basically the question is, what are you trying to achieve? Let's see if you really need the local space bind pose transforms.

It sounds like there is no real way to get the correct bind pose transforms of those first bones, but they will not be needed for playing back animation on the skeleton or to render the skeleton correctly. But you might be trying to do something that just isn't possible here as the information isn't stored in the FBX. This can be solved by doing some art changes though, but again it shouldn't be needed unless you really need a bind pose for all nodes.

There is one more workaround you could otherwise do, and that is to store the vertex data in world space, and use the first frame as bind pose. I'm not sure however if the FBX sdk allows you to get the skinned vertex data in world space already. Also the quality of the skinning can be lower this way.

Also you could just try to get the world space transform of frame 0. Use that to calculate the local space bind pose transform (so using the scene evaluator for those bones that have no cluster). As long as you end up with the correct world space bind transform during skinning it should be fine. But normally you don't calculate the bind pose world transforms yourself, you just store them once without needing the local space bind pose transforms to reconstruct them.

This topic is closed to new replies.

Advertisement