I am parenting objects to bones. But when I am getting the parent of the objects I get just the Armature. Is it posible to get the specific bone?
After that can I get the pose values of the bone and translate them to object Ipo?
Any help is wellcomed.
I am new in Blender Api.
Now how I can set the parent of an Object to be a Bone.
you cant at the moment, may be worth adding to the api. do you need it or just interested?
I need it.
I am trying to create a way that I can use bone animation and get results in BGE with Bullet physics.
The aproch that I taked was to find the vertexs that are in the group of any bone. Create from those vertexs a Convex Hull ( Convex Hull by Michael S.) then I have to make those Conex hull objects childs of the bone. After that I Bake in a way the animation that comes out in the Objects. This way I get collision Objects that I can use with Bullet and follows the skinned Object with the Action.
Also another thing that it is usefull is to be able to set that armature at rest position. This way when there is allready an animation we will be able to switch armature to rest position parent the objects and then swhitch back to the normal mode and have the proper translation.
Also what I am trying to do it’s not something official. What I mean… It’s not part of Blender or Bullet project. Ofcurse after I finish I will share the code.
in CVS now , commit log
adding ob_arm.makeParentBone([ob1, ob2…], bonename)
ob.parentbonename is also settable now as long as it already has a bone parent
will “arm.restPosition = True” do what you want?
Yes arm.restPosition = True works as expected. Thanks.
Well thanks for the adition. I hope it was not very hard. Well I don’t have the knowledge and the ability to build the CVS. So I will create a first vertion of it that you will have to add the bones manually.
Try compiling with this (Im on linux but I assume most others are winxp?)
It was harder then I expected to add because I didnt know how to ask if an armature had a bone with a spesific name. once that was worked out the rest of the API stuff is fairly standard.
Otherwise keep an eye on
I’m not in a position to directly benefit from this right now, but I have to say - Well done ideasman42.
I don’t think I’ve ever seen such a quick response that involved adding something to the code. I’m continually impressed by blender and the blender community.
1000 Thanks ideasman42.
ideasman42 as we started this. One think that bothers me is that if I call:
arm = Blender.Armature.Get( wrong name )
arm is None. But the same for Object returns error. Is there any reason for this or just something that was missed.
API Stuff is best discussed here…
Can you join the list? Id rather these issues are raised in an area where other Python API people are about,
short answer IMHO Armature.Get(…) should raise an error if the name dosnt exist but not sure if we should change it now, thats where the Mailing list is better to discuss.