From 696b0366f5c46dcfcb50f53b4ca4f59c593b88fb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 5 Feb 2011 07:08:34 +0000 Subject: update for changes in mathutuils. --- rigify/rigs/misc/delta.py | 6 +++--- rigify/utils.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'rigify') diff --git a/rigify/rigs/misc/delta.py b/rigify/rigs/misc/delta.py index 2157970a..bc5f7eba 100644 --- a/rigify/rigs/misc/delta.py +++ b/rigify/rigs/misc/delta.py @@ -144,15 +144,15 @@ def set_mat(obj, bone_name, matrix): a.transform(matrix) - d = acos(a.matrix.to_quat().dot(matrix.to_quat())) * 2 + d = acos(a.matrix.to_quaternion().dot(matrix.to_quaternion())) * 2.0 roll_1 = a.roll + d roll_2 = a.roll - d a.roll = roll_1 - d1 = a.matrix.to_quat().dot(matrix.to_quat()) + d1 = a.matrix.to_quaternion().dot(matrix.to_quaternion()) a.roll = roll_2 - d2 = a.matrix.to_quat().dot(matrix.to_quat()) + d2 = a.matrix.to_quaternion().dot(matrix.to_quaternion()) if d1 > d2: a.roll = roll_1 diff --git a/rigify/utils.py b/rigify/utils.py index 84d4c4f1..f0a19aac 100644 --- a/rigify/utils.py +++ b/rigify/utils.py @@ -237,12 +237,12 @@ def obj_to_bone(obj, rig, bone_name): mat = rig.matrix_world * bone.matrix_local - obj.location = mat.translation_part() + obj.location = mat.to_translation() obj.rotation_mode = 'XYZ' obj.rotation_euler = mat.to_euler() - scl = mat.scale_part() + scl = mat.to_scale() scl_avg = (scl[0] + scl[1] + scl[2]) / 3 obj.scale = (bone.length * scl_avg), (bone.length * scl_avg), (bone.length * scl_avg) -- cgit v1.2.3