[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [875] trunk/py/scripts/addons/ space_view3d_panel_measure.py: global mode wasn' t taking rotation into account properly.

Fabian Fricke frigi.f at googlemail.com
Sat Jul 31 02:07:34 CEST 2010


Revision: 875
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=875
Author:   frigi
Date:     2010-07-31 02:07:33 +0200 (Sat, 31 Jul 2010)

Log Message:
-----------
global mode wasn't taking rotation into account properly.

Modified Paths:
--------------
    trunk/py/scripts/addons/space_view3d_panel_measure.py

Modified: trunk/py/scripts/addons/space_view3d_panel_measure.py
===================================================================
--- trunk/py/scripts/addons/space_view3d_panel_measure.py	2010-07-30 23:07:26 UTC (rev 874)
+++ trunk/py/scripts/addons/space_view3d_panel_measure.py	2010-07-31 00:07:33 UTC (rev 875)
@@ -210,6 +210,8 @@
             ob_mat = obj.matrix_world
             # Also make an inversed copy! of the matrix.
             ob_mat_inv = ob_mat.copy().invert()
+            # And a transposed one...
+            ob_mat_trans = ob_mat.copy().transpose()
 
             # Get the selected vertices.
             # @todo: Better (more efficient) way to do this?
@@ -249,7 +251,7 @@
                     return (p1, p2, COLOR_LOCAL)
 
                 else:
-                    p1 = vert_loc * ob_mat + obj_loc
+                    p1 = vert_loc * ob_mat_trans + obj_loc
                     p2 = cur_loc
                     return (p1, p2, COLOR_GLOBAL)
 
@@ -268,8 +270,8 @@
                     return (p1, p2, COLOR_LOCAL)
 
                 else:
-                    p1 = obj_loc + vert1_loc * ob_mat
-                    p2 = obj_loc + vert2_loc * ob_mat
+                    p1 = obj_loc + vert1_loc * ob_mat_trans
+                    p2 = obj_loc + vert2_loc * ob_mat_trans
                     return (p1, p2, COLOR_GLOBAL)
 
             else:




More information about the Bf-extensions-cvs mailing list