I have created a grid of hexagons. I want to animate the rotation of a series of them diagonally, so I have parented each hexagon to its own Empty, and rotated the Empty's orientation to the angle I want to rotate the hexagons at. But when I try to rotate each Empty on its local x-axis using python script, I can't seem to get the expected rotation. What I've tried so far:
Selected Empty in 3D viewport, then ran (where the value "1.5708" is the equivalent of rotating 90 degrees):
bpy.context.object.rotation.euler[0] = 1.5708
or . . .
bpy.ops.transform.rotate(value=1.5708,
axis=(0.866025, 0.5, 0),
constraint_axis=(True, False, False),
constraint_orientation='LOCAL',
mirror=False,
proportional='DISABLED',
proportional_edit_falloff='SMOOTH',
proportional_size=1,
release_confirm=True)
The first one results in an error:
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'Object' object has no attribute 'rotation'
The second one rotates the Empty, but not according to local x-axis. (looks like maybe global x-axis)
Note: the above commands come from the info panel where first one is the same as setting rotation in the "Properties" panel (N key in 3D Viewport) and second one is the result of using the 3D Manipulation Widget
I am using Blender 2.73a on Mac OSX 10.8.5