Home Unreal Engine

Converting Unreal Rotation ( Uelers ) To maya rotations

polycounter lvl 11
Offline / Send Message
raul polycounter lvl 11
Hello, how does one go about converting the ueler angles from unreal to degrees in maya so that the assets in maya and unreal have exactly the same rotation?  Ive been trying to do some math but i cant figure out.  Here a snipet from an example i found, but the resulting values are too small so i guessing there is still one step more to do. I also dont really understand ueler angles that much.

Thanks!

from maya.api import OpenMaya as om


unreal_rot = [ 90, 55, -125.0 ]


# swap z and y position

maya_rot = om.MEulerRotation(math.radians(unreal_rot[0]), math.radians(unreal_rot[1] + 90.0), math.radians(unreal_rot[2]))

print maya_rot[0], maya_rot[1], maya_rot[2]

Replies

  • Butthair
    Options
    Offline / Send Message
    Butthair polycounter lvl 11
    I see "swap z and y"..

    When you export as fbx, what is your axis conversion set to? is it Y-Up or Z-Up? Is that the rotation your are trying to convert. Also, which why are you converting -  from unreal to maya or maya to unreal?
  • raul
    Options
    Offline / Send Message
    raul polycounter lvl 11
    Hi, Maya is set to Y up. And it would go back and forth. 

    In a nutshell i am trying to make a maya to unreal link. So i can send stuff between the two programs. But it would be the poor mans version. Since all im interested on is the reference's name and translations. I am attaching a link to dropbox with a quick video and the script itself. Maybe someone could look at it and help me out. 

    https://www.dropbox.com/s/vt6dd21c38y22mx/mayatounreal.zip?dl=0

  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    You can't just swap axes,  you'll need to do a matrix transform on everything  (I write this sort of thing when required and then forget everything I know but I'm sure someone will be able to point you at an appropriate maths link.. 
  • Lsleepless
    Options
    Offline / Send Message
    Lsleepless polycounter lvl 8
    In case any one else runs into the problem, the solution is to swap Y for Z and invert (Can invert by multiplying with -1). You can write a matrix to convert, but can also just swap. Then the rotation order needs to be set to XZY in Maya before any modifications are made, at least for Relative Rotations in Unreal. Have not looked into if there are differences between the rotation order with Relative and World Space Rotations in Unreal.
Sign In or Register to comment.