[Bf-extensions-cvs] [be0c6b3d] master: Fix T75615: Export Animation to Nuke (chan file) Broken curve

Damien Picard noreply at git.blender.org
Wed May 26 01:07:33 CEST 2021


Commit: be0c6b3d9ed1430218e289f1813b8d0a5be93175
Author: Damien Picard
Date:   Sat Dec 5 16:08:54 2020 +0100
Branches: master
https://developer.blender.org/rBAbe0c6b3d9ed1430218e289f1813b8d0a5be93175

Fix T75615: Export Animation to Nuke (chan file) Broken curve

Use previous rotation as euler_compat on matrix conversion

===================================================================

M	io_anim_nuke_chan/export_nuke_chan.py

===================================================================

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)



More information about the Bf-extensions-cvs mailing list