From 2883242cdecb86687450a84948b1d9cb88ebf061 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 27 Apr 2006 12:51:09 +0000 Subject: [PATCH] Lightwave mot exporter now does worldspace loc/size/rot --- release/scripts/export_lightwave_motion.py | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/release/scripts/export_lightwave_motion.py b/release/scripts/export_lightwave_motion.py index 166bc49dc20..888e11ef3ba 100644 --- a/release/scripts/export_lightwave_motion.py +++ b/release/scripts/export_lightwave_motion.py @@ -58,8 +58,8 @@ ObjSelect = B.Object.GetSelected() def FuncionPrincipal (Dir): B.Window.WaitCursor(1) - for O in ObjSelect: - origName= NombreObjeto= O.name + for ob in ObjSelect: + origName= NombreObjeto= ob.name print '----\nExporting Object "%s" motion file...' % origName SC = B.Scene.getCurrent() @@ -102,25 +102,27 @@ def FuncionPrincipal (Dir): while FrameA < (FrameF + 1): B.Set('curframe', FrameA) - + + mat= ob.mat # Worldspace matrix + if NumCanal == 0: - Val = O.LocX + Val = mat.translationPart().x elif NumCanal == 1: - Val = O.LocZ + Val = mat.translationPart().z elif NumCanal == 2: - Val = O.LocY + Val = mat.translationPart().y elif NumCanal == 3: - Val = -O.RotZ + Val = -mat.toEuler().z elif NumCanal == 4: - Val = -O.RotX + Val = -mat.toEuler().x elif NumCanal == 5: - Val = -O.RotY + Val = -mat.toEuler().y elif NumCanal == 6: - Val = O.SizeX + Val = mat.scalePart().x elif NumCanal == 7: - Val = O.SizeZ + Val = mat.scalePart().z 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)))