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:
authorCampbell Barton <ideasman42@gmail.com>2011-12-31 13:59:39 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-31 13:59:39 +0400
commite1c5b9022d2df9a893dfc03ba6884be80bc91718 (patch)
tree3a70ed9c7a48af6693e4c30f74440e50be549185 /space_view3d_copy_attributes.py
parent92cda885fcad3a8b03f57051e8bc417d6662c59c (diff)
a little nicer use of matrix types, no functional changes
Diffstat (limited to 'space_view3d_copy_attributes.py')
-rw-r--r--space_view3d_copy_attributes.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/space_view3d_copy_attributes.py b/space_view3d_copy_attributes.py
index 72277a39..5134a2e9 100644
--- a/space_view3d_copy_attributes.py
+++ b/space_view3d_copy_attributes.py
@@ -26,10 +26,10 @@ bl_info = {
"api": 42846,
'location': 'View3D > Ctrl-C',
'description': 'Copy Attributes Menu from Blender 2.4',
- 'wiki_url': 'http://wiki.blender.org/index.php/Extensions:2.5/Py/'\
- 'Scripts/3D_interaction/Copy_Attributes_Menu',
- 'tracker_url': 'https://projects.blender.org/tracker/index.php?'\
- 'func=detail&aid=22588',
+ 'wiki_url': 'http://wiki.blender.org/index.php/Extensions:2.5/Py/'
+ 'Scripts/3D_interaction/Copy_Attributes_Menu',
+ 'tracker_url': 'https://projects.blender.org/tracker/index.php?'
+ 'func=detail&aid=22588',
'category': '3D View'}
import bpy
@@ -92,14 +92,14 @@ def getmat(bone, active, context, ignoreparent):
'''Helper function for visual transform copy,
gets the active transform in bone space
'''
- data_bone = context.active_object.data.bones[bone.name]
+ obj_act = context.active_object
+ data_bone = obj_act.data.bones[bone.name]
#all matrices are in armature space unless commented otherwise
otherloc = active.matrix # final 4x4 mat of target, location.
- bonemat_local = Matrix(data_bone.matrix_local) # self rest matrix
+ bonemat_local = data_bone.matrix_local.copy() # self rest matrix
if data_bone.parent:
- parentposemat = Matrix(
- context.active_object.pose.bones[data_bone.parent.name].matrix)
- parentbonemat = Matrix(data_bone.parent.matrix_local)
+ parentposemat = obj_act.pose.bones[data_bone.parent.name].matrix.copy()
+ parentbonemat = data_bone.parent.matrix_local.copy()
else:
parentposemat = parentbonemat = Matrix()
if parentbonemat == parentposemat or ignoreparent:
@@ -117,8 +117,7 @@ def rotcopy(item, mat):
item.rotation_quaternion = mat.to_3x3().to_quaternion()
elif item.rotation_mode == 'AXIS_ANGLE':
quat = mat.to_3x3().to_quaternion()
- item.rotation_axis_angle = Vector([quat.axis[0],
- quat.axis[1], quat.axis[2], quat.angle])
+ item.rotation_axis_angle = quat.axis[:] + (quat.angle, )
else:
item.rotation_euler = mat.to_3x3().to_euler(item.rotation_mode)