diff options
author | Damien Picard <dam.pic@free.fr> | 2020-12-05 18:08:54 +0300 |
---|---|---|
committer | Damien Picard <dam.pic@free.fr> | 2021-05-26 00:11:49 +0300 |
commit | be0c6b3d9ed1430218e289f1813b8d0a5be93175 (patch) | |
tree | 7ed83da3f1e3aeb84fcc540cd6d777e98aa96bed /io_anim_nuke_chan | |
parent | b2948ae5fa060f6891d7edfefbee3c9f37394027 (diff) |
Fix T75615: Export Animation to Nuke (chan file) Broken curve
Use previous rotation as euler_compat on matrix conversion
Diffstat (limited to 'io_anim_nuke_chan')
-rw-r--r-- | io_anim_nuke_chan/export_nuke_chan.py | 8 |
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) |