[Bf-extensions-cvs] [2fe9e91] master: fix for axis-angle rotation copying, used to be a copy of quats code. From a patch by Bartek Skorupa

Bartek Skorupa noreply at git.blender.org
Fri Jan 30 02:59:19 CET 2015


Commit: 2fe9e9163bb4d4a128fdf2bf8bf100a3e1427441
Author: Bartek Skorupa
Date:   Thu Jan 29 20:56:57 2015 -0500
Branches: master
https://developer.blender.org/rBA2fe9e9163bb4d4a128fdf2bf8bf100a3e1427441

fix for axis-angle rotation copying, used to be a copy of quats code. From a patch by Bartek Skorupa

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

M	space_view3d_copy_attributes.py

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

diff --git a/space_view3d_copy_attributes.py b/space_view3d_copy_attributes.py
index 7f90ebe..a80fd70 100644
--- a/space_view3d_copy_attributes.py
+++ b/space_view3d_copy_attributes.py
@@ -114,8 +114,9 @@ def rotcopy(item, mat):
     if item.rotation_mode == 'QUATERNION':
         item.rotation_quaternion = mat.to_3x3().to_quaternion()
     elif item.rotation_mode == 'AXIS_ANGLE':
-        quat = mat.to_3x3().to_quaternion()
-        item.rotation_axis_angle = quat.axis[:] + (quat.angle, )
+        rot = mat.to_3x3().to_quaternion().to_axis_angle()  # returns (Vector((x, y, z)), w)
+        axis_angle = rot[1], rot[0][0], rot[0][1], rot[0][2]  # convert to w, x, y, z
+        item.rotation_axis_angle = axis_angle
     else:
         item.rotation_euler = mat.to_3x3().to_euler(item.rotation_mode)



More information about the Bf-extensions-cvs mailing list