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

Séverin Lemaignan severin.lemaignan at laas.fr
Thu Jul 28 10:47:28 CEST 2011


You can also check the human_posture.py "sensor" in MORSE that access 
(but do not directly modify) the armature.

https://github.com/laas/morse/blob/master/src/morse/sensors/human_posture.py

Severin

On 07/28/2011 09:03 AM, Peter Roelants wrote:
> </>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
>
>
>
> _______________________________________________
> Robotics mailing list
> Robotics at blender.org
> http://lists.blender.org/mailman/listinfo/robotics

-- 
           Séverin Lemaignan - severin.lemaignan at laas.fr
   [00]    PhD student on Cognitive Robotics
  /|__|\   LAAS-CNRS - RIS group / Technische Uni München - IAS group
    ''     +33561337844 / +498928917780
           http://www.laas.fr/~slemaign


More information about the Robotics mailing list