I wrote my CHAN exporter in Maya.
But the rotation order is wrong. I can adjust the rotation order in my script. But what is the correct order between Maya and T4?
import maya.cmds as cmds
import math
def dump_camera_channels( cameraName, time ):
current = time
shapeName = cmds.listRelatives(cameraName,shapes=True)[0]
tx = cmds.getAttr(cameraName+".tx", t=current)
ty = cmds.getAttr(cameraName+".ty", t=current)
tz = cmds.getAttr(cameraName+".tz", t=current)
rx = cmds.getAttr(cameraName+".rx", t=current)
ry = cmds.getAttr(cameraName+".ry", t=current)
rz = cmds.getAttr(cameraName+".rz", t=current)
return str(current) + " " + str(tx) + " " + str(ty) + " " + str(tz) + " " + str(rx*-1) + " " + str(ry*-1) + " " + str(rz*-1)
def export_camera( filename, cameraName, **kwargs ):
st = 1
ed = 1
step = 1
if 'st' in kwargs:
st = kwargs['st']
if 'ed' in kwargs:
ed = kwargs['ed']
if 'step' in kwargs:
step = kwargs['step']
print('df')
f = open( filename, 'w')
for time in xrange(st, ed, step):
print(time)
l = dump_camera_channels( cameraName, time )
f.write(l + "\n")
f.close()
export_camera( "C:\\DATA\\Projects\\F16 Project\\PRODUCTION\\Maya\\scenes\\Shot1\\test.chan", "nurbsCircle1", st = 1, ed = 189 )