get rotation from Armature?


I don’t know if anyone can help me with this, but I’m running out of ideas here!

I am trying to write a script that will return the rotation of a bone in an armature - but nothing I do seems to work!! I haven’t been able to access bones within the armature via python. I was under the impression that one of the updates for 2.24 or 2.25 was python access to armatures!! Does anybody have the release notes of 2.24 and 2.25?

I have tried to get the rotation of objects parented to the bone, objects parented to the object (which was parented to the bone) as well as getting the rotation of objects with a copyRotation constraint to the bone!! Nothing! :frowning:

If it’s the armature that is causing the rotation, then as far as python is concerned the objects are not rotating! So it keeps returning ‘0’.

What I’m trying to do is something similar to the ‘copyRotation constraint’ but I need to get the xRot from one object and the yRot from another. The ‘copyRotation constraint’ does not allow us to choose which axis to copy unlike the ‘copyLocation’

Any suggestions or workarounds are appreciated. With any luck it’s just a function in the module that I’m not noticing!

Thank you for your suggestions and time! :slight_smile:


<font size=-1>[ This Message was edited by: ilac on 2002-03-19 17:09 ]</font>

The only way you can do this as far as I know of, is, when the armatures have ipo’s, convert the quaternion curves to euler rotations. The armature access was still not finished for 2.25 I think…

Hi eeshlo,

Thanks for your help - twice over actually! Theeth had pointed me in the right direction by pointing me to matrices (of object parented to the armature). But I was doing pretty badly even with that till I came across the code you put in another (the mat2eular) message on the is board :slight_smile: Thanks!

I still didn’t manage to use it successfully (me’s an idiot, I know :P) but it was returning better angle values than my method was. Time constraints forced me to look in another direction for a workaround (which I found: it’s really cheating and has nothing to do with my original intentions but it worked!)

Right now I’m still very busy and to make matters worse I’m running a fever :frowning: So I don’t feel like thinking 'too’much at the moment. Obviously the fever, to the readers’s dismay, does not succeed in getting me to write shorter messages :stuck_out_tongue:

So thank you both for your help, Theeth and Eeshlo! :smiley:

Fabrizio (who needs to go and lie dow…