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:
authorBartek Skorupa <bartekskorupa@bartekskorupa.com>2015-01-30 04:56:57 +0300
committerbassam kurdali <bassam@ashndrome-02.hampshire.edu>2015-01-30 04:56:57 +0300
commit2fe9e9163bb4d4a128fdf2bf8bf100a3e1427441 (patch)
treea0075828b27e837450c70a9dac0b58eb22917c1c /space_view3d_copy_attributes.py
parenta72a199986162d900bbfd9454e7a6faec3a44a77 (diff)
fix for axis-angle rotation copying, used to be a copy of quats code. From a patch by Bartek Skorupa
Diffstat (limited to 'space_view3d_copy_attributes.py')
-rw-r--r--space_view3d_copy_attributes.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/space_view3d_copy_attributes.py b/space_view3d_copy_attributes.py
index 7f90ebe4..a80fd700 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)