[Bf-blender-cvs] [0f201049b4b] master: Edit Mesh: tag the object data for updating instead of the object

Campbell Barton noreply at git.blender.org
Sun Jul 11 07:32:26 CEST 2021


Commit: 0f201049b4b2011ab940a5689867e190930d561e
Author: Campbell Barton
Date:   Sun Jul 11 15:17:11 2021 +1000
Branches: master
https://developer.blender.org/rB0f201049b4b2011ab940a5689867e190930d561e

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.

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

M	source/blender/editors/space_view3d/view3d_buttons.c

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

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:



More information about the Bf-blender-cvs mailing list