With Python 2.6.2 for blender version 2.49. I want [“OBCube”] to copy the orientation of [“OBSphere”] on only 1 axis and still keep the same data for the second and third. So, basically I want the cube to still stay upright when it is copying the orientation of the sphere. I attempted to do this with setting axis[0] and axis[1] to the same as the sphere and assigning axis[2] to the cube’s own axis[2] but it doesn’t seem to work. No errors in the console but I still think its a syntax error on my part. Here is my script (2.49)
scene = GameLogic.getCurrentScene()
cube = scene.objects[‘OBCube’]
sphere = scene.objects[‘OBSphere’]
cubeori = cube.orientation
sphereori = sphere.orientation
cubeori[0] = sphereori[0]
cubeori[1] = sphereori[1]
cubeori[2] = cubeori[2] # keeps same orientation on Z axis
cube.setOrientation(cubeori) # sets orientation to newest data.
I know that setOrientation() is deprecated but “cube.orientation = x” doesnt seem to work. But when I use setOrientation, it DOES change the orientation, but it always sets the cube’s orientation exactly to the sphere as if I never defined the new orientation of the cube.
Any ideas?