Assimp : aiMesh & aiBone

Started by
2 comments, last by All8Up 12 years, 2 months ago
I don't understand one thing. In Assimp aiMesh represents master-geometry. For example : model has two identical pouldrons - left and right. Therefore we can have only one mesh and use it twice. Right? But.. aiMesh has an aiBone array. Each bone refers to aiNode by mName, is this true (or maybe it's other, independent entity)? Also each bone has a matrix. But we already have matrix for each node in hierarchy. Does that mean that aiNode is not "full master geometry"? I can't understand this moment.
Advertisement
Assimp does not instance meshes, so if your mesh has two pauldrons, they will be imported as separate meshes

Assimp does not instance meshes, so if your mesh has two pauldrons, they will be imported as separate meshes
I think this is not right. aiNode can refer to aiMesh by index. And one mesh can be used in some nodes with various matrix. This works fine with static geometry. As I understand it, it will not work with skinned mesh. Really, for animation(skinning) we must have two various pauldron meshes.
I'm fairly certain that you are correct and the aiMesh can do references with transformation information so a left can be an instance of a right with a -x transform attached. But, the question is where you are getting your data from. "Most" exporters will collapse such instanced items and perform the transformation internally thus exporting a left and right version as unique data. I use Modo for most of my test "programmer art" meshes (lots of cubes :)) and it supports instanced meshes which are not duplicated, but I don't believe any of it's exporters honor that and they just spit out the transformed mesh as a unique item. Maya is much the same and I imagine many others are similar. Assimp would have to directly support the Modo format in order to get the real un-flattened form of the mesh. Given that Modo/Max/Maya/etc don't directly work with formats Assimp can read, both for legal and complexity reasons (Max contains plugin data chunks, script chunks etc and has sued folks for trying to reverse engineer it, Maya now owned by the same is similar in complexity and problems) your exporters are probably the issue.

You might give FBX a try and I believe there is an plugin project to Assimp you can get which, if you download the FBX SDK and install it (registration and annoying bs to get the sdk last time I downloaded it, but "notme@nowhere.com" worked) that code may help you out. I have no idea if it will preserve instancing though, FBX "usually" preserves most data, at least from Max and Maya, but no guarantee's.

This topic is closed to new replies.

Advertisement