[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2337] trunk/py/scripts/addons/rigify/ rig_ui_template.py: Rigify: changed quat/ vector multiplication order to conform to api changes.

Nathan Vegdahl cessen at cessen.com
Tue Sep 20 05:46:56 CEST 2011


Revision: 2337
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2337
Author:   cessen
Date:     2011-09-20 03:46:54 +0000 (Tue, 20 Sep 2011)
Log Message:
-----------
Rigify: changed quat/vector multiplication order to conform to api changes.

Modified Paths:
--------------
    trunk/py/scripts/addons/rigify/rig_ui_template.py

Modified: trunk/py/scripts/addons/rigify/rig_ui_template.py
===================================================================
--- trunk/py/scripts/addons/rigify/rig_ui_template.py	2011-09-20 02:10:55 UTC (rev 2336)
+++ trunk/py/scripts/addons/rigify/rig_ui_template.py	2011-09-20 03:46:54 UTC (rev 2337)
@@ -81,7 +81,7 @@
             par_rest = Matrix()
 
         q = (par_rest.inverted() * rest).to_quaternion()
-        pose_bone.location = loc * q
+        pose_bone.location = q * loc
 
 
 def set_pose_rotation(pose_bone, mat):
@@ -200,7 +200,7 @@
 
     # Compensate for the rotation difference
     if angle > 0.0001:
-        pv *= Matrix.Rotation(angle, 4, ikv).to_quaternion()
+        pv = Matrix.Rotation(angle, 4, ikv).to_quaternion() * pv
         set_pole(pv)
 
         # Get rotation difference again, to see if we
@@ -210,7 +210,7 @@
         angle2 = acos(min(1,max(-1,q1.dot(q2)))) * 2
         if angle2 > 0.0001:
             # Compensate in the other direction
-            pv *= Matrix.Rotation((angle*(-2)), 4, ikv).to_quaternion()
+            pv = Matrix.Rotation((angle*(-2)), 4, ikv).to_quaternion() * pv
             set_pole(pv)
 
 



More information about the Bf-extensions-cvs mailing list