Moving a bone

Hey guys,

I have a model made on a program called MakeHuman. I imported it with Blender and then I used YABEE to export that model to egg.

I am having trouble when trying to move a bone from this model’s arm. I tried the code bellow, but it did not work.

self.eve = Actor("boneco") #Load our animated charachter                           
    self.eve.reparentTo(render)          #Put it in the scene

    self.bone = self.eve.exposeJoint(None, 'modelRoot', 'UpArm_L')

However, when I try to rotate the entire model, using the code bellow, it works perfectly.


Does anybody know if the problem is in the way I am trying to program or in the model itself?


ExposeJoint will copy (each frame) the joint’s transform to the NodePath you provided. The controverse is controlJoint, which copies the NodePath’s transform to the joint each frame. So to control a joint you need to use… controlJoint. ExposeJoint is usefull if you e. g. have a particular visual effect or model you want to move along with a joint, maybe a glowing sphere around a hand.

Thanks for your help!

I have another issue: when I try to move a bone by using setH() (setP() or setR()), I think it rotates with the middle point of the bone as the center of the rotaion, but I wish to take one of the ends of the bone to be the center.

Is it possible to chose the center of the rotation? Or by using setH() (setP() or setR()) this won’t be possible?

You have to construct the bone so that the (0, 0, 0) point is the center of rotation. This usually means setting an appropriate translate on the parent bone.