Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'io_anim_nuke_chan/export_nuke_chan.py')
-rw-r--r--io_anim_nuke_chan/export_nuke_chan.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/io_anim_nuke_chan/export_nuke_chan.py b/io_anim_nuke_chan/export_nuke_chan.py
index d1c9a9b4..9b5f6420 100644
--- a/io_anim_nuke_chan/export_nuke_chan.py
+++ b/io_anim_nuke_chan/export_nuke_chan.py
@@ -22,7 +22,7 @@
It takes the currently active object and writes it's transformation data
into a text file with .chan extension."""
-from mathutils import Matrix
+from mathutils import Matrix, Euler
from math import radians, degrees
@@ -39,6 +39,7 @@ def save_chan(context, filepath, y_up, rot_ord):
# prepare the correcting matrix
rot_mat = Matrix.Rotation(radians(-90.0), 4, 'X').to_4x4()
+ previous_rotation = Euler()
filehandle = open(filepath, 'w')
fw = filehandle.write
@@ -65,10 +66,13 @@ def save_chan(context, filepath, y_up, rot_ord):
fw("%f\t%f\t%f\t" % t[:])
# create rotation component
- r = mat.to_euler(rot_ord)
+ r = mat.to_euler(rot_ord, previous_rotation)
fw("%f\t%f\t%f\t" % (degrees(r[0]), degrees(r[1]), degrees(r[2])))
+ # store previous rotation for compatibility
+ previous_rotation = r
+
# if the selected object is a camera export vertical fov also
if camera:
vfov = degrees(camera.angle_y)