[Robotics] Code Snippets or Best Practices on BGE and Bones

Peter Roelants peter.roelants at gmail.com
Thu Jul 28 09:03:14 CEST 2011


So,

Benoit Bolsee added support for controlling armatures in the BGE like you
can read in [1]

The individual bones in the BGE are called 'channels' and you can find their
API in [2]. You can get these channels trough the BGE armature object,
with BL_ArmatureObject.channels [3]. You can read and write the joint
rotation values with the BL_ArmatureChannel.joint_rotation attribute
[4]. Don't forget to call BL_ArmatureObject.update() [5] after you have set
the joint rotation.

If you have an active IK constraint on a bone, be sure to remove this.
Because this wil reset the joint_rotation values.

This all is for Blender 2.5.., I don't know if it's possible to move
individual bones in the BGE in lower versions of Blender.

Greetings,
Peter

[1] http://lists.blender.org/pipermail/robotics/2009-September/000114.html
[2]
http://www.blender.org/documentation/blender_python_api_2_57_release/bge.types.html#bge.types.BL_ArmatureChannel
[3]
http://www.blender.org/documentation/blender_python_api_2_58_release/bge.types.html#bge.types.BL_ArmatureObject.channels
[4]
http://www.blender.org/documentation/blender_python_api_2_57_release/bge.types.html#bge.types.BL_ArmatureChannel.joint_rotation
[5]
http://www.blender.org/documentation/blender_python_api_2_58_release/bge.types.html#bge.types.BL_ArmatureObject.update
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/robotics/attachments/20110728/a13c606c/attachment.htm 


More information about the Robotics mailing list