diff options
author | Fabian Fricke <frigi.f@googlemail.com> | 2010-07-31 04:07:33 +0400 |
---|---|---|
committer | Fabian Fricke <frigi.f@googlemail.com> | 2010-07-31 04:07:33 +0400 |
commit | 370ba896bf0dd89ca68a0baaf5ae6edd0f9f3b99 (patch) | |
tree | 05afbc3677eb9cfa5b8ec3ef0c387b062d80b320 | |
parent | 4d512d3124a5db1d6ccb7ea2cbfdb6dcbd8d50da (diff) |
global mode wasn't taking rotation into account properly.
-rw-r--r-- | space_view3d_panel_measure.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/space_view3d_panel_measure.py b/space_view3d_panel_measure.py index f7588365..5c7cc381 100644 --- a/space_view3d_panel_measure.py +++ b/space_view3d_panel_measure.py @@ -210,6 +210,8 @@ def getMeasurePoints(context): 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 @@ def getMeasurePoints(context): 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 @@ def getMeasurePoints(context): 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: |