Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Buerbaum <martin.buerbaum@gmx.at>2012-03-21 15:11:31 +0400
committerMartin Buerbaum <martin.buerbaum@gmx.at>2012-03-21 15:11:31 +0400
commit23508ee0c303c4f54a57559e2f948f402de0feed (patch)
treed85b214eed311fe5a1d13fa271fdb49a9a42edf8 /space_view3d_panel_measure.py
parentb38cb00d5be6acdc214dc8883a4f2da5e134a527 (diff)
* Measure Panel - Version 0.8.8
* Fixed normal calculation (again) for global mode.
Diffstat (limited to 'space_view3d_panel_measure.py')
-rw-r--r--space_view3d_panel_measure.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/space_view3d_panel_measure.py b/space_view3d_panel_measure.py
index af3faffe..c2292d28 100644
--- a/space_view3d_panel_measure.py
+++ b/space_view3d_panel_measure.py
@@ -27,7 +27,7 @@ bl_info = {
"author": "Buerbaum Martin (Pontiac), TNae (Normal patch)," \
" Benjamin Lauritzen (Loonsbury; Volume code)," \
" Alessandro Sala (patch: Units in 3D View)",
- "version": (0, 8, 7),
+ "version": (0, 8, 8),
"blender": (2, 6, 0),
"location": "View3D > Properties > Measure Panel",
"description": "Measure distances between objects",
@@ -387,8 +387,14 @@ def polyAreaGlobal(poly, obj):
area = n.length / 2.0
- # Apply world matrix to normal as well.
- norm = mat * norm
+ # Apply rotation and scale to the normal as well.
+ rot_mat = obj.matrix_world.to_quaternion()
+ scale = obj.matrix_world.to_scale()
+ norm = rot_mat * norm
+ norm = Vector((
+ norm.x * scale.x,
+ norm.y * scale.y,
+ norm.z * scale.z)).normalized()
return area, norm