From be1edb7e389d7762d18449b918a826f0ca6fef08 Mon Sep 17 00:00:00 2001
From: Campbell Barton <ideasman42@gmail.com>
Date: Thu, 27 Dec 2012 07:30:18 +0000
Subject: [PATCH] fix [#33657] Loop tools crash in face select mode

---
 mesh_looptools.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/mesh_looptools.py b/mesh_looptools.py
index f909033d6..7b1509f0c 100644
--- a/mesh_looptools.py
+++ b/mesh_looptools.py
@@ -751,7 +751,14 @@ def settings_write(self):
 
 # clean up and set settings back to original state
 def terminate(global_undo):
-    bpy.context.user_preferences.edit.use_global_undo = global_undo
+    context = bpy.context
+
+    # update editmesh cached data
+    obj = context.active_object
+    if obj.mode == 'EDIT':
+        bmesh.update_edit_mesh(obj.data, tessface=True, destructive=True)
+
+    context.user_preferences.edit.use_global_undo = global_undo
 
 
 ##########################################
@@ -2997,6 +3004,7 @@ class Bridge(bpy.types.Operator):
             if self.remove_faces and old_selected_faces:
                 bridge_remove_internal_faces(bm, old_selected_faces)
             # make sure normals are facing outside
+            bmesh.update_edit_mesh(object.data, tessface=False, destructive=True)
             bpy.ops.mesh.normals_make_consistent()
         
         # cleaning up
-- 
GitLab