diff options
author | NBurn <nbwashburn@gmail.com> | 2017-08-02 13:16:26 +0300 |
---|---|---|
committer | NBurn <nbwashburn@gmail.com> | 2017-08-02 13:16:26 +0300 |
commit | 69cb19cf71bf62fddb5e43e1aa31a807e839eb41 (patch) | |
tree | f44bb0df47c8cba527e681b8b87f55a817dc5fe9 /measureit/measureit_main.py | |
parent | 9d3a25cac02a56afa898e930e6f4dfa270fd4c28 (diff) |
MeasureIt: Fix for ensure_lookup_table bug mentioned in T52236
Diffstat (limited to 'measureit/measureit_main.py')
-rw-r--r-- | measureit/measureit_main.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/measureit/measureit_main.py b/measureit/measureit_main.py index 5476931c..633a1754 100644 --- a/measureit/measureit_main.py +++ b/measureit/measureit_main.py @@ -26,6 +26,7 @@ # ---------------------------------------------------------- # noinspection PyUnresolvedReferences import bpy +import bmesh from bmesh import from_edit_mesh # noinspection PyUnresolvedReferences import bgl @@ -411,6 +412,10 @@ class MeasureitEditPanel(Panel): if (ms.gltype == 1 or ms.gltype == 12 or ms.gltype == 13 or ms.gltype == 14) and ms.gltot != '99' \ and ms.glfree is False: # only segments + if bpy.context.mode == "EDIT_MESH": + bm = bmesh.from_edit_mesh(bpy.context.edit_object.data) + if hasattr(bm.verts, "ensure_lookup_table"): + bm.verts.ensure_lookup_table() if ms.glpointa <= len(obverts) and ms.glpointb <= len(obverts): p1 = get_point(obverts[ms.glpointa].co, myobj) if ms.gltype == 1: |