Bones rotation from python script

Hi there,

I been looking for a solution to my problem in forums and tutorials without luck, I thought this would be something very basic. I am a beginner with Python and Blender but have already read a lot of tutorials so what I’m missing is a lot of practice.
My problem: how to move individual bones within an armature from python within GameEngine. The armature is parenting an extruded cylinder connected to a cube, the armature has an Always sensor connected to the Python Controller which is connected to an Action Actuator. After clicking “P”, nothing happens, I’m trying to move the forearm but it stays always in the same position.
I’m attaching a very simple arm and the code of what I have manage to understand on how to do this. I’m working with python5.2, Blender 2.49a. Thanks for your help,
Apollo

import GameLogic as g
cont  = g.getCurrentController()
scene = g.getCurrentScene()
own = cont.owner
actArm = cont.actuators[0]
#    print actArm.channelNames
loc,size,quat = actArm.getChannel('ForeArm')
print "Loc:",loc
print "Size:",size
print "Quat:",quat
quat = [0,1,0,0]
actArm.setChannel( 'ForeArm', loc, size, quat )
cont.activate(actArm)    

Attachments

firstArmV02.blend (189 KB)