align to axis problem

Can someone please take a look at this .blend and tell me why the Y axis wont align correctly (it appears to align to the -Y axis instead).

Is this a bug or am I doing something wrong?


alignYaxis.blend (134 KB)

I seem to be stupid or my blender 2.48 is different, but I can’t see any wrong y-axis. Explain further!

On my machine the top object rotates clockwise, the bottom anti-clockwise - do you see different? I’m using 249.2.

This seems more complicated than it needs to be,

How hard would it be to set and get an object’s rotation using x,y,z values,
or how would you convert the orientation matrix to accomplish this?


alignYaxis fix.blend (136 KB)

You are right PhilB but shouldn’t it work anyway? I’m trying to understand if this is the expected behaviour of the method or not.

Ahh sorry, I’ve downloaded the file. I see what you mean now. Thanks.

Is my workaround not the proper solution? I don’t understand the matrix enough to know,
It would seem that your original idea should work.
Maybe some values are switched around, or they should be?

Found this be triel and error:
vec = cube.orientation[1]
own.alignAxisToVect(vec, 1,1)

I hope it helps

PhilB, your solution does work correctly (I’m not sure why though). You are right it does seem more complicated than it needs to be.

Monster - Thanks I should have though of that. Shame that its trial and error.

I think this is indeed a bug. I also noticed something similar happening when trying to track bones with setChannel(). I’ll post it to the tracker.