From 0f201049b4b2011ab940a5689867e190930d561e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 11 Jul 2021 15:17:11 +1000 Subject: Edit Mesh: tag the object data for updating instead of the object When editing vertices with number buttons, tag the mesh, not the object. This prevents the evaluated mesh being re-created for the object and is correct as the mesh is being edited not the object. Note that all tags for updating object geometry should be checked to see if this change should be applied there too. From a simple test on a high-poly mesh this gives around 1.3x overall speedup. --- source/blender/editors/space_view3d/view3d_buttons.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index dcd4ff8df36..2e203d06b12 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1152,7 +1152,7 @@ static void do_view3d_vgroup_buttons(bContext *C, void *UNUSED(arg), int event) ViewLayer *view_layer = CTX_data_view_layer(C); Object *ob = view_layer->basact->object; ED_vgroup_vert_active_mirror(ob, event - B_VGRP_PNL_EDIT_SINGLE); - DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); + DEG_id_tag_update(ob->data, ID_RECALC_GEOMETRY); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); } @@ -1568,7 +1568,7 @@ static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event case B_TRANSFORM_PANEL_MEDIAN: if (ob) { v3d_editvertex_buts(NULL, v3d, ob, 1.0); - DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); + DEG_id_tag_update(ob->data, ID_RECALC_GEOMETRY); } break; case B_TRANSFORM_PANEL_DIMS: -- cgit v1.2.3