• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
MarkJSmith

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

14 posts in this topic

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

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

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.

Edited by Buckshag
0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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.

Edited by Buckshag
0

Share this post


Link to post
Share on other sites
I am also not sure what you really want.
Do you not want to make a standard skinned animation play?
Is there some reason the standard way of doing this won’t work?

Every FbxNode has a translation matrix, both local and world (that includes the bind pose).

Your approach in determining what matrix to use is exactly backwards.
It’s not, “If no cluster influence, then what?”, it’s, “Use the node’s matrix unless influenced by a cluster.”
You don’t need a pose, shape, influence, cluster, or even a skin to determine what matrix to use. These things are add-ons, not foundational/necessary elements.


In any case, getting a local matrix is trivial.
If there is no parent, the world matrix is its local matrix, otherwise the local matrix is the inverse of the parent’s matrix multiplied by the node’s world matrix.
I just hesitate before giving you this answer because you seem really lost and I feel as though I am just helping you further down the spider hole.


L. Spiro
0

Share this post


Link to post
Share on other sites
In any case, getting a local matrix is trivial.
If there is no parent, the world matrix is its local matrix, otherwise the local matrix is the inverse of the parent’s matrix multiplied by the node’s world matrix.
I just hesitate before giving you this answer because you seem really lost and I feel as though I am just helping you further down the spider hole.

 

 

He cannot extract a bind pose if it isn't there.

But he might think he needs the bind pose transforms for those nodes, while he probably doesn't need them.

Using the node matrix can be incorrect, as it is not the real bind pose, but again it shouldn't matter as for skinning you only need the bind pose matrices of the nodes that are inside a cluster anyway. So we have to find out what he really is trying to do here.

0

Share this post


Link to post
Share on other sites

Looks like it's needed to attach weapons.

But joints are part of the scene graph just as meshes and models are.
Attaching something to it is just a matter of making it a child of that object and is an entirely separate issue from extracting skin weights from FBX files.
There is extreme confusion all around. I pray the fire topic-started be clearer.
 

He cannot extract a bind pose if it isn't there.

He says he can get the bind pose easily in his first post. The problem seems to be about some bones having no clusters (the FBX term for skin weights) attached to them.
My confusion begins here: Why does he think all bones need skin weights? If the bone doesn’t influence any vertices directly, there will be no skin weights. So?

The bone he circled in the image would be examples of joints that are not influencing any vertices.

Then he goes on to ask how to calculate the bind-pose matrices for joints with no skinning weights.
HUH??
The locations of the joints/bones is nothing to do with whether or not they have skinning weights/clusters.  They are all nodes, all nodes except root nodes have a parent, and all bones/joints in a skeleton can be put into bind pose simply by traversing the bind-pose hierarchy via only this information.  Never does a bind pose relate to skin weights/clusters at all.
 
 
So I (and everyone else) am confused on 2 points:
#1: Some bones/joints don’t have clusters.  SO?
#2: Why does he think they need clusters to calculate a bind pose??


“Buckshag, what does the C-Meter say about his confused level?”
It’s over 9,000!!!!
http://www.youtube.com/watch?v=SiMHTK15Pik


L. Spiro Edited by L. Spiro
0

Share this post


Link to post
Share on other sites
He says he can get the bind pose easily in his first post. The problem seems to be about some bones having no clusters (the FBX term for skin weights) attached to them.
My confusion begins here: Why does he think all bones need skin weights? If the bone doesn’t influence any vertices directly, there will be no skin weights. So?

The bone he circled in the image would be examples of joints that are not influencing any vertices.

Then he goes on to ask how to calculate the bind-pose matrices for joints with no skinning weights.
HUH??
The locations of the joints/bones is nothing to do with whether or not they have skinning weights/clusters.  They are all nodes, all nodes except root nodes have a parent, and all bones/joints in a skeleton can be put into bind pose simply by traversing the bind-pose hierarchy via only this information.  Never does a bind pose relate to skin weights/clusters at all.
 
 
So I (and everyone else) am confused on 2 points:
#1: Some bones/joints don’t have clusters.  SO?
#2: Why does he think they need clusters to calculate a bind pose??

 

 

I think he thinks he needs the bind pose world space matrices for the node without cluster as he wants to store a bind pose in local space.

In order to calculate the local space transform in bind pose he needs to get the bind pose transform of the node with red circle. This is true IF you really would need the local space bind pose for all nodes. But this is not needed for regular animation as you know.

 

I have the feeling he is trying to reconstruct the full bind pose in world space by doing forward kinematics on those local space transforms.

But instead he should just store the bind pose matrices in world space of all nodes that act as real bone in the skinning info of the mesh. And as for skinning you do not need the bind pose transform of the red circled node it would solve his full problem.

 

So unless he really needs the correct bind pose he should just do it that way and skip the whole local space bind pose extracting as that info just isn't there, unless an artist adds a bind pose to the FBX.

 

 

“Buckshag, what does the C-Meter say about his confused level?”
It’s over 9,000!!!!

 

 

Haha :) I think its clear what he wants, he just needs to understand he doesn't need this bind pose transform of the red marked node and that he should just store the bind pose transforms as world space matrix for the other nodes.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0