Page 1 of 1

Bones with skin

Posted: Wed Jun 04, 2008 3:53 am
by wyrmmage
First off, sorry for posting two questions so close to each other....I'm pretty sure that this question has nothing to do with my other one, though :P

I have a .b3d model that uses bones and has cubes for the skin. Currently I have one cube for each bone, and everything is working out fine :) Unfortunately, it appears that for a bone to be recognized by Irrlicht, it must have a piece of skin attached to it; even then, the bone itself is not accessible through a call to getJointNode(), only the skin. Since I'm planning on having quite a few different characters with large height differences/bone structures, I would like to define a place in my model where I can attach a camera and have it follow the parent bone's rotation/scale/etc. Actually, I'd like to have two or three different places to attach cameras. I was going to try making three different bones named FPSCameraBone, OverheadCameraBone, and FollowCameraBone, but since the bones are not recorded (since they do not have skin), then I'm rather in a bind.

Giving a bone an empty node as a child (in Blender, not in Irrlicht) seems to have no effect - the bone is still discarded and the empty child node is discarded as well :(
Any ideas on how I should go about implementing this?

Thanks :)
-wyrmmage

Posted: Wed Jun 04, 2008 7:43 am
by arras
You can pass around this problem probably by simply modeling some geometry to that joint, set it to have its own material so it loads as meshbuffer then remove it manually in Irrlicht. But I was not trying that myself so its only idea.

Bye the way, if joints without geometry are really discarded in loader it would be good candidate for "feature request" ...or "bug report". Some chance is however that it is not Irrlicht loader which discards them but your exporter which optimize your data while writing file and discards empty joints.

Posted: Wed Jun 04, 2008 12:15 pm
by hybrid
empty structures are also often discarded in the loaders, because of possible performance problems due to countless invisible stuff. But you're right, it's a good candidate for a parameter making this changeable.

Posted: Thu Jun 05, 2008 3:16 am
by wyrmmage
thanks everyone, I'll have to try the idea that arras suggested, since it should be relatively simple to do. An option in the loader would definitely be cool as well :)
-wyrmmage

Posted: Thu Jun 05, 2008 9:56 am
by Luke
having a quick look though the code, I cannot see anywhere that empty bones are removed. I don't think I did that for your reason.

so you might want to check that your exporter is not removing them.


hmm, btw if no bones have skin attached, and you have no animation, your mesh is not marked as animated, this may cause problems, but shouldn't.
the bone itself is not accessible through a call to getJointNode(), only the skin
don't get what you mean here, you can only access the bone.

Posted: Thu Jun 05, 2008 8:58 pm
by wyrmmage
Luke wrote:don't get what you mean here, you can only access the bone.
I'll have to check my exporter later to make sure it's not removing empty bones.

Perhaps I'm not truly "skinning" the bone? All I'm doing is have a bone with a child polygon attached. If I have a bone called chestBone and a cube as a child object to the chestBone called chest then if I call getJointNode("chestBone"), it returns NULL; if I call getJointNode("chest"), it returns the address to the node. Perhaps the getJointNode() call is returning the value of the bone that the skin is attached to, but it seems odd that calling getJointNode() with the name of a bone would return nothing :\

-wyrmmage