From 7bfe53dda9669fac3dd27cf66acea745c74353d8 Mon Sep 17 00:00:00 2001 From: JoseConseco Date: Sat, 11 Nov 2023 15:40:18 +0100 Subject: [PATCH] new bmesh refresh method This will use bmesh.update_edit_mesh() rather than old hack ( toggling to object then edit mode) --- mesh_f2.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mesh_f2.py b/mesh_f2.py index 64b382f63..dc7a58f66 100644 --- a/mesh_f2.py +++ b/mesh_f2.py @@ -1,5 +1,3 @@ -# SPDX-FileCopyrightText: 2013-2022 Blender Foundation -# # SPDX-License-Identifier: GPL-2.0-or-later # Updated for 2.8 jan 5 2019 @@ -181,9 +179,11 @@ def quad_from_edge(bm, edge_sel, context, event): if loop.vert.index in uv_ori: loop[uv_layer].uv = uv_ori[loop.vert.index] + bm.normal_update() + bmesh.update_edit_mesh(context.active_object.data) # toggle mode, to force correct drawing - bpy.ops.object.mode_set(mode='OBJECT') - bpy.ops.object.mode_set(mode='EDIT') + # bpy.ops.object.mode_set(mode='OBJECT') + # bpy.ops.object.mode_set(mode='EDIT') # create a face from a single selected vertex, if it is an open vertex @@ -305,9 +305,10 @@ def quad_from_vertex(bm, vert_sel, context, event): x, y = uv_sel loop[uv_layer].uv = (x, y) + bmesh.update_edit_mesh(context.active_object.data) # toggle mode, to force correct drawing - bpy.ops.object.mode_set(mode='OBJECT') - bpy.ops.object.mode_set(mode='EDIT') + # bpy.ops.object.mode_set(mode='OBJECT') + # bpy.ops.object.mode_set(mode='EDIT') def expand_vert(self, context, event): -- 2.30.2