Move a bone through python script

Hi,

I’m searching a way to use python ton control bone mouvements (rotations) like it’s possible to do in Blender module.
There’s no way for the moment or I have forget something ! ???

I couldn’t find any BGE code regarding armature control, however there is the Python Blender Armature Submodule you might beable to do something with. Other than that, the only thing I can think of that should suit your criteria is delta IPO actions linked to whatever you want to control the bones with, as opposed to playing a pre-set action set, you’d be delta-setting the verticies a small increment to achieve a custom location when the BGE is active. Sorry I can’t be of more detailed help, I’ve never had the need to generate anything other than theory in this area.

THe direct way via setChannel() does not work.

But you can set up an action that makes the rotation for you. Then you can control the action with an action actuator controlled by a property. By changing the property you can perform the rotation.

Example:
An action rotates the bone around the x-axis. At zero it is the rest position, at 90 it is rotated 90 degrees, at 180 it is rotated 180 degrees and so on.
Now you set up an action actuator (property) set to a property “frame”. “frame” is an int property.
Activate the actiuator at startup:
always (no pulse) -> and -> Action Actuator “Action” (frame)

When you set “frame” to 90 the bone is rotated 90 degrees. When you set “frame” to 180 it is rotated 180 degrees.

I hope it helps

I think this is the only solution !!
So for Each bone i must have 3 actions.
I will make some test.

my test with 2 axis with on bone is working.
but it’s very long technic :frowning: