Advertisement

Assimp bones' relation to nodes

Started by September 19, 2018 01:20 PM
4 comments, last by Pilpel 6 years, 2 months ago

I noticed that when importing animated meshes, the total number of bones (aiBone) in the scene might be less than the total number of nodes (aiNode), so my initial thought was "okay their hierarchies are probably not related.. whatever", but then I noticed that an aiBone object doesn't contain a pointer to a parent bone.

So my question is how do I calculate the final matrix palette for the bones, not knowing the hierarchy between them?

Edit: I forgot to mention that according to some book I read every joint (bone) must store an index to its parent joint.

I don't have code around so I can't tell you for sure, but I believe that for each aiBone there is an aiNode with the same name. An aiNode has a parent and children, so you would need to match bones with nodes and then you can traverse the skeleton through the nodes (and get the corresponding bones from the nodes).

Advertisement

So what's the deal with the nodes that don't have corresponding bones?

I noticed this, "i think assimp discards any bone nodes that are not being used by the mesh in question (i.e. have zero weight). Hence the discrepancy between the full skeleton, and the aiBone list for the mesh."

Could that be the case here? Are you positive those bones are being used by the mesh?

Here is where I got that from: https://github.com/assimp/assimp/issues/1787

5 hours ago, AtomicWinter said:

Are you positive those bones are being used by the mesh?

What do you mean? These bones don't exist, as in no aiMesh ever refers to them.

Just to be sure, I don't need the mTransformation matrix of the aiNodes anymore when doing skinning, right?

Edit: I think I was wrong in the statement above actually. :p

Edit2: I'll just start a new topic about that issue, hopefuly you can help me (no spam intended)

This topic is closed to new replies.

Advertisement