Blender + Collada + ofxAssimploader: Bones not working

Hi everybody,

I am struggling to export a mesh with bones in Collada from Blender to use with ofxAssimpLoader.

I am just trying a simple bone structure, starting with the root bone, just to see if it works but mainly I get this message from Assimp:
[error] ofxAssimpModelLoader: Validation failed: aiMesh::mBones is non-null although there are no bones

In Blender my mesh is a child of ‘Armature’. Armature contains the bones as well.

When exporting I tried almost every setting but without success.
I thought by selecting only the Armature and then choosing ‘Selection only’, ‘Include Children’, ‘Include Aramtures’ should do the trick but nothing seems to work…
I tried Apply modifiers as well without success.

Just exporting the mesh works fine, but when I try to export it with the bones it doesn’t work.
Even the preview window in osx doesn’t get it right with the bones.

If somebody could point me in the right direction that would be great.
I am using Blender version 2.66.1

Thanks a lot!

I haven’t tried to modify the bones using Assimp before, but I have had trouble when passing the optimize flag as true in ofxAssimpModelLoader::loadModel(ofBuffer & buffer, bool optimize, const char * extension);

If you have that as true, maybe passing false might help?

Hi Nick,

Seems to work like a charm.
I was sure, I tried that before, but I guess that must have been in my mind only or something :slight_smile:

So thismay seem like a regular cube with some mesh deform, but it’s actually rotated joints from a Collada exported in Blender and loaded with Assimp.

Behold the boned cube:

It seems to work for two bones and a cube.
Let’s take it from there :slight_smile:

Thanks a lot Nick!

Glad to help out. FYI, I can’t see the image. :confused:
I would love to hear more about your findings with this subject, I have always wanted to experiment with bones, but haven’t got around to it.

Hey,

Interesting thread. I’ve had so much trouble with Blender -> Collada -> OF/Assimp, maybe one of you could offer advice?

I’ve animated a simple cube in Blender which moves and rotates over a few frames, but cannot get the animation to playback in OF. I’ve tried adding an armature modifier with bone, setting as parent of the cube, and flattening animation. Animation works fine in Blender and even in the finder window, but not OF. I’ve also tried pretty much every export/import setting with no luck.

wimvanhenden do you have an example of your cube with 2 bones I could see?

Unrelated, but I also had a lot of trouble with textures. Eventually I sorted those issues with the following (may be of use to someone):
1/ image size must be power of 2
2/ manually editing the image filepath in the .dae file or change ofxAssimpModelLoader to allow absolute paths with texPath.data
3/ forcing the mesh to be single sided in ofxAssimpModelLoader- meshHelper.twoSided = false;

Thanks,
Trent

Hi guys,

I’ve been doing a lot of work the past few days. But the skeleton is getting better.
Here you can download a stickman figure with bones as blender and dae file:

note: the bones called l_hip_static and r_hip_static are intented to be rotated.

http://www.nocomputer.be/yescomputer/stickmannocomputer.zip

I will upload some code as well when it’s a bit more complete.
I have added a lot of addons and code (ofxopenni stuff) which is redundant actually.

Cheers,