[Bf-extensions-cvs] [059aa141] master: MeasureIt: Partial Fix of T52236

NBurn noreply at git.blender.org
Tue Aug 1 10:02:43 CEST 2017


Commit: 059aa141639c93f075f2d75b5ff509d590a7219b
Author: NBurn
Date:   Tue Aug 1 03:58:41 2017 -0400
Branches: master
https://developer.blender.org/rBA059aa141639c93f075f2d75b5ff509d590a7219b

MeasureIt: Partial Fix of T52236

===================================================================

M	measureit/__init__.py
M	measureit/measureit_geometry.py
M	measureit/measureit_main.py
M	measureit/measureit_render.py

===================================================================

diff --git a/measureit/__init__.py b/measureit/__init__.py
index 56e9716b..bc9ce20f 100644
--- a/measureit/__init__.py
+++ b/measureit/__init__.py
@@ -29,7 +29,7 @@ bl_info = {
     "name": "MeasureIt",
     "author": "Antonio Vazquez (antonioya)",
     "location": "View3D > Tools Panel /Properties panel",
-    "version": (1, 6, 9),
+    "version": (1, 7, 0),
     "blender": (2, 7, 4),
     "description": "Tools for measuring objects.",
     "wiki_url": "https://wiki.blender.org/index.php/Extensions:2.6/"
diff --git a/measureit/measureit_geometry.py b/measureit/measureit_geometry.py
index 5c63e5d4..14328a9e 100644
--- a/measureit/measureit_geometry.py
+++ b/measureit/measureit_geometry.py
@@ -624,9 +624,6 @@ def draw_segments(context, myobj, op, region, rv3d):
 
                             d1, dn = distance(p1, p2)
                             midpoint3d = interpolate3d(p1, p2, fabs(d1 / 2))
-                            tmp_point = get_2d_point(region, rv3d, midpoint3d)
-                            if tmp_point is not None:
-                                txtpoint2d = tmp_point[0] + ms.glfontx, tmp_point[1] + ms.glfonty
                             # Scale
                             if scene.measureit_scale is True:
                                 tot = tot * scene.measureit_scale_factor
@@ -644,7 +641,10 @@ def draw_segments(context, myobj, op, region, rv3d):
                             if scene.measureit_gl_show_n is True and ms.glnames is True:
                                 msg += ms.gltxt
                             if scene.measureit_gl_show_d is True or scene.measureit_gl_show_n is True:
-                                draw_text(myobj, txtpoint2d, msg, ms.glcolorarea, fsize)
+                                tmp_point = get_2d_point(region, rv3d, midpoint3d)
+                                if tmp_point is not None:
+                                    txtpoint2d = tmp_point[0] + ms.glfontx, tmp_point[1] + ms.glfonty
+                                    draw_text(myobj, txtpoint2d, msg, ms.glcolorarea, fsize)
 
                 except IndexError:
                     ms.glfree = True
@@ -1195,7 +1195,7 @@ def draw_faces(context, myobj, region, rv3d):
                     b2d = get_2d_point(region, rv3d, a_p2)
                     c2d = get_2d_point(region, rv3d, a_p3)
                     # draw vectors
-                    if a2d is not None and b2d is not None and c2d is not None: 
+                    if None not in (a2d, b2d, c2d):
                         draw_arrow(a2d, b2d, 10, "99", "1")
                         draw_arrow(b2d, c2d, 10, "99", "1")
                         # Normal vector data
diff --git a/measureit/measureit_main.py b/measureit/measureit_main.py
index b8f31324..5476931c 100644
--- a/measureit/measureit_main.py
+++ b/measureit/measureit_main.py
@@ -1641,8 +1641,8 @@ class RenderSegmentButton(Operator):
             # noinspection PyBroadException
             try:
                 result = bpy.data.images['Render Result']
-                if result.has_data is False:
-                    bpy.ops.render.render()
+                #if result.has_data is False:
+                bpy.ops.render.render()
             except:
                 bpy.ops.render.render()
             print("MeasureIt: Using current render image on buffer")
diff --git a/measureit/measureit_render.py b/measureit/measureit_render.py
index af567c91..f15a9575 100644
--- a/measureit/measureit_render.py
+++ b/measureit/measureit_render.py
@@ -191,6 +191,8 @@ def render_main(self, context, animation=False):
                     for myobj in selobj:
                         if scene.measureit_debug_objects is True:
                             draw_object(context, myobj, None, None)
+                        elif scene.measureit_debug_object_loc is True:
+                            draw_object(context, myobj, None, None)
                         if scene.measureit_debug_vertices is True:
                             draw_vertices(context, myobj, None, None)
                         elif scene.measureit_debug_vert_loc is True:



More information about the Bf-extensions-cvs mailing list