From 007092f081d7a7a5f453ebd7c89e859dfce39d8e Mon Sep 17 00:00:00 2001 From: Campbell Barton <ideasman42@gmail.com> Date: Sat, 26 Mar 2011 00:43:10 +0000 Subject: [PATCH] Scale is a class method, no need to instance the class first. Matrix().Scale --> Matrix.Scale --- rigify/rig_ui_template.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rigify/rig_ui_template.py b/rigify/rig_ui_template.py index 136cb44b5..516525a25 100644 --- a/rigify/rig_ui_template.py +++ b/rigify/rig_ui_template.py @@ -39,7 +39,7 @@ def get_pose_matrix_in_other_space(mat, pose_bone): rest_inv = rest.inverted() if pose_bone.parent: par_mat = pose_bone.parent.matrix.copy() - par_inv = pose_bone.parent.matrix.inverted() + par_inv = par_mat.inverted() par_rest = pose_bone.parent.bone.matrix_local.copy() else: par_mat = Matrix() @@ -56,9 +56,9 @@ def get_pose_matrix_in_other_space(mat, pose_bone): loc *= rest.inverted().to_quaternion() if pose_bone.bone.use_inherit_scale: t = par_mat.to_scale() - par_scale = Matrix().Scale(t[0], 4, Vector((1,0,0))) - par_scale *= Matrix().Scale(t[1], 4, Vector((0,1,0))) - par_scale *= Matrix().Scale(t[2], 4, Vector((0,0,1))) + par_scale = Matrix.Scale(t[0], 4, Vector((1,0,0))) + par_scale *= Matrix.Scale(t[1], 4, Vector((0,1,0))) + par_scale *= Matrix.Scale(t[2], 4, Vector((0,0,1))) else: par_scale = Matrix() @@ -71,9 +71,9 @@ def get_pose_matrix_in_other_space(mat, pose_bone): rot = smat.to_quaternion() scl = mat.to_scale() - smat = Matrix().Scale(scl[0], 4, Vector((1,0,0))) - smat *= Matrix().Scale(scl[1], 4, Vector((0,1,0))) - smat *= Matrix().Scale(scl[2], 4, Vector((0,0,1))) + smat = Matrix.Scale(scl[0], 4, Vector((1,0,0))) + smat *= Matrix.Scale(scl[1], 4, Vector((0,1,0))) + smat *= Matrix.Scale(scl[2], 4, Vector((0,0,1))) smat *= Matrix.Rotation(rot.angle, 4, rot.axis) smat[3][0] = loc[0] smat[3][1] = loc[1] @@ -215,7 +215,7 @@ def match_pole_target(ik_first, ik_last, pole, match_bone, length): ploc = a + (ikv/2) + pvi # Set pole target to location - mat = get_pose_matrix_in_other_space(Matrix().Translation(ploc), pole) + mat = get_pose_matrix_in_other_space(Matrix.Translation(ploc), pole) set_pose_translation(pole, mat) bpy.ops.object.mode_set(mode='OBJECT') -- GitLab