Hi Folks

I’m trying to have two objects (e.g. two cubes) in blender, which are rotationally constraint to each other, such that the rotation of the first object will result in a turn of the second object. The point where python comes into play is to readout the rotation angle out uf the scene. The goal for this is to constantly readout the rotation state of all objects via python and a serial interface to an arduino in order to replicate the movements on a robot.

Here is what I tried:

Opening Blender and adding e second cube using Add->Mesh->Cube. Then shifting the second cube to a different position and adding an object constraint to the new cube “Cube.001”:

Copy Rotation for X, Y and Z on target “Cube”; Space: World Space <-> World Space

I then rotate the first cube and the second cube is rotating as well - great.

Here comes the part where I don’t know what’s happening. Going to the python console in the Scripting window gives me this:

>>> import bpy

>>> bpy.data.objects[“Cube”].rotation_euler

Euler((0.5927…, 0.0573…, 0.0136…), “XYZ”)

>>> bpy.data.objects[“Cube.001”].rotation_euler

Euler((0,0,0), “XYZ”)

Why does the 2nd cube not update its euler angles, when I rotate the first cube? Both cubes are rotating in the 3D view…

The strange thing is - when I rotate the second cube, then no rotation is visible in the 3D representation, but the euler angles of just the 2nd cube change…

Seems like on the python level, the two cubes are not constraint to each other…

Cheers