Absolute position/rotation of child object

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
dsnettleton
Posts: 0
Joined: Sat Jan 19, 2013 8:38 pm
Location: Morehead, KY

Absolute position/rotation of child object

Post by dsnettleton » Sun Jan 20, 2013 12:20 am

I have an object bound to a bone, and I need the absolute position and rotation of the object (world coordinates), but I can't seem to figure out how to get them.
obj.parent returns the armature, so obj.matrix_local is relative to the armature and not the bone it's parented to. I can get the bone object using obj.parent.data.bones[obj.parent_bone], and I'm trying to get absolute transformations using

Code: Select all

armature.matrix_world * parentBone.matrix_local * obj.matrix_basis
to no avail. Unfortunately, I have to fetch this regardless of animation transformations (in the rest pose) so I can't use obj.matrix_local
For what it's worth, I would probably settle for translation and rotation relative to the parent bone itself. I use quaternions for rotations.

Post Reply