Hello everyone,
After numerous trials and error and restarting maya and unreal each time (I don’t know how to refresh the python compilation, and uneal m2u seems to be dead each time I close and reopen maya), I made some dirty modifications to 3 py script on the maya side so that:
- Maya can work in Y-up and sync perfectly with unreal (working in Z-up could be a problem since I use mocap and it seems the world space in Maya and unreal is +/- reversed even setup to be z-up, making me so confused in adjusting numbers)
- cam sync also works
- when fetch from the editor, I found that the fbx has -90 x rotation which makes my previous effort useless. I don’t know how to implement a fix in the m2u script. but I do managed to write a seperate py script to clean the mess to make the sync work again if objects are fetched from the editor. maya to unreal is not affect.
4.hope someone could make it better. I am not a programmer, please excuse the mess.
import maya.cmds as cmds
selectedObjects = cmds.ls (sl=True,type='transform')
for obj in selectedObjects:
#print selectedObjects
rx,ry,rz = cmds.xform(obj,query=True, ws=True, ro=True)
rx = rx + 90
cmds.xform(obj,r=False, ro=(-90, 0, 0))
cmds.makeIdentity(obj,apply=True, t=0, r=1, s=0, n=0)
cmds.xform(obj,r=True, ro=(rx,ry,rz))
