Copying rotation of an object using constraints

Hi !

I have a little problem with Copying rotation of an object.

I’m making an animation with a lizard. The Skeleton is an armature including many bones. I’m studying a method to get the animation the simples as possible. It is quite automated : I have done it for arms and legs, an I can move them with only 2 bones used as handles, like I’d move a wire puppet. But I still have a little problem with the tail.

I have added an empty which have 2 copy location constraints aiming 2 feet, and a track constraint aiming one foot. This empty is parented to the armature, and rotates when the lizard walks. I Want to use this Empty to get a rotation of the bone at the tip of the tail, for each step of the lizard.

Previously, I have use several methods to copy the rotation of an object:

The copy rotation constraint, as used fot the Empty described above, and a second method using a small python script.

Here, I need the second method, because I have to give the tail a negative rotation, thing that is not possible using constraints.

I’m not use at all with Python, but this script has few lines. It allows the copy of the rotation of an object , even if the axis of the two objects are oriented differently (copy of the rotation according to local axis, I think, instead of global).

In my current lizard project, this scripts doesn’t works !

Previously, when I used the script to rotate objects (for a machine with gears), the object used as master was rotated by an Ipo curve. The slave object, moved by the copy rotation script rotated perfectly.

In the current project, the object used as master (the Empty) is rotated By copy rotation constraints. The script seems not to detect this rotation !

I have put a simplified Blend file showing the problem, here :

Use right click to copy the target, or download it with you favourite soft.

Have you got an idea to help me copy this rotation ?

Thanks in advance.


The URL gives me a 403 error but I think I know what the problem is (assuming you are using the Rot property of the object).

Constraints does not affect object properties directly, they only affect the orientation matrix, so if you want to copy the real rotation of an object modified by a constraint, you’ll have to extract the euler angles from the matrix of the object (I believe the Mathutils module has a function to do that).