How to change bone rotation via python

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
kroopson
Posts: 18
Joined: Sun Oct 13, 2002 7:40 pm

How to change bone rotation via python

Post by kroopson » Sun Feb 12, 2006 2:42 pm

Hi - I'm trying to make a script in which I want to change bones rotation values. However it works and bones do rotate, but the problem is, that I don't get any transformation from objects parented to the bones.

Code: Select all

cube = Object.Get('Cube')

driver = Object.Get('ramie')
driverd = driver.getData()
dp = driver.getPose()
dpb = dp.bones['ramie1']

rot = cube.LocY
rot = Mathutils.Euler(0,0,rot)
rot = rot.toQuat()

dpb.quat = rot
dp.update()

an-toni
Posts: 0
Joined: Wed Mar 17, 2004 5:20 pm

Post by an-toni » Tue Feb 14, 2006 4:15 pm

havent tried that - might a bit later, now just asking to make sure i understand correctly: the bone rotates as wanted, but the deformation it should cause is not updated? is it updated at some later point? am wondering if this is a missing dependency graph call in the api.

~Toni

Post Reply