change bones position in a armature in blender game engine using python
I am working on real time mapping of model with the user data obtained from Kinect. I am able to get access to the individual bone using bge.types.BL_ArmatureObject().channels which give the list of bones. I am not able to change the position bone. I tried to use rotation_euler to give it some rotation but it had no effect. Pleas开发者_如何转开发e tell me how to do it.
Maybe a little late, but for blender >= 2.5 this should do the trick:
# Get the whole bge scene
scene = bge.logic.getCurrentScene()
# Helper vars for convenience
source = scene.objects
# Get the whole Armature
main_arm = source.get('NAME OF YOUR ARMATURE')
main_arm.channels['NAME OF THE BONE YOU WANT TO ROTATE'].joint_rotation[ x, y ,z] # x,y,z = FLOAT VALUE
main_arm.update()
I also wrote this down in an extensive tutorial, starting here: http://www.warp1337.com/content/blender-robotics-part-1-introduction-and-modelling
精彩评论