Lightwave mot exporter now does worldspace loc/size/rot

This commit is contained in:
Campbell Barton 2006-04-27 12:51:09 +00:00
parent 176a4c8507
commit 2883242cde

@ -58,8 +58,8 @@ ObjSelect = B.Object.GetSelected()
def FuncionPrincipal (Dir): def FuncionPrincipal (Dir):
B.Window.WaitCursor(1) B.Window.WaitCursor(1)
for O in ObjSelect: for ob in ObjSelect:
origName= NombreObjeto= O.name origName= NombreObjeto= ob.name
print '----\nExporting Object "%s" motion file...' % origName print '----\nExporting Object "%s" motion file...' % origName
SC = B.Scene.getCurrent() SC = B.Scene.getCurrent()
@ -102,25 +102,27 @@ def FuncionPrincipal (Dir):
while FrameA < (FrameF + 1): while FrameA < (FrameF + 1):
B.Set('curframe', FrameA) B.Set('curframe', FrameA)
mat= ob.mat # Worldspace matrix
if NumCanal == 0: if NumCanal == 0:
Val = O.LocX Val = mat.translationPart().x
elif NumCanal == 1: elif NumCanal == 1:
Val = O.LocZ Val = mat.translationPart().z
elif NumCanal == 2: elif NumCanal == 2:
Val = O.LocY Val = mat.translationPart().y
elif NumCanal == 3: elif NumCanal == 3:
Val = -O.RotZ Val = -mat.toEuler().z
elif NumCanal == 4: elif NumCanal == 4:
Val = -O.RotX Val = -mat.toEuler().x
elif NumCanal == 5: elif NumCanal == 5:
Val = -O.RotY Val = -mat.toEuler().y
elif NumCanal == 6: elif NumCanal == 6:
Val = O.SizeX Val = mat.scalePart().x
elif NumCanal == 7: elif NumCanal == 7:
Val = O.SizeZ Val = mat.scalePart().z
elif NumCanal == 8: elif NumCanal == 8:
Val = O.SizeY Val = mat.scalePart().y
File.write (' Key %f %f 3 0 0 0 0 0 0\n' % (Val, (FrameA/FrameRate))) File.write (' Key %f %f 3 0 0 0 0 0 0\n' % (Val, (FrameA/FrameRate)))