diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-10-14 02:54:46 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-10-20 02:32:02 +0300 |
commit | f780bfafcfa988d1415f5758ceebbe1b4aee9ba7 (patch) | |
tree | e866f7a6d02bf33c905810f2f1f927b28386adb3 /source/blender/editors/sculpt_paint/sculpt_face_set.c | |
parent | 48fd10a77dd8e53eb0ef063ce11bf4086fdb9f17 (diff) |
Fix missing Sculpt Overlays updates when using modifiers
Now that sculpt mask and face sets can also be drawn without using the
PBVH, these operators need these extra updates when the data changes.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8956
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_face_set.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_face_set.c | 43 |
1 files changed, 9 insertions, 34 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.c b/source/blender/editors/sculpt_paint/sculpt_face_set.c index 152d23dfa5b..af6a06caf69 100644 --- a/source/blender/editors/sculpt_paint/sculpt_face_set.c +++ b/source/blender/editors/sculpt_paint/sculpt_face_set.c @@ -303,7 +303,6 @@ static int sculpt_face_set_create_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); SculptSession *ss = ob->sculpt; - ARegion *region = CTX_wm_region(C); Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); const int mode = RNA_enum_get(op->ptr, "mode"); @@ -406,8 +405,7 @@ static int sculpt_face_set_create_exec(bContext *C, wmOperator *op) SCULPT_undo_push_end(); - ED_region_tag_redraw(region); - WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); + SCULPT_tag_update_overlays(C); return OPERATOR_FINISHED; } @@ -664,7 +662,6 @@ static int sculpt_face_set_init_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); SculptSession *ss = ob->sculpt; - ARegion *region = CTX_wm_region(C); Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); const int mode = RNA_enum_get(op->ptr, "mode"); @@ -734,13 +731,7 @@ static int sculpt_face_set_init_exec(bContext *C, wmOperator *op) BKE_mesh_flush_hidden_from_verts(ob->data); } - ED_region_tag_redraw(region); - DEG_id_tag_update(&ob->id, ID_RECALC_SHADING); - - View3D *v3d = CTX_wm_view3d(C); - if (!BKE_sculptsession_use_pbvh_draw(ob, v3d)) { - DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); - } + SCULPT_tag_update_overlays(C); return OPERATOR_FINISHED; } @@ -823,7 +814,6 @@ static int sculpt_face_sets_change_visibility_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); SculptSession *ss = ob->sculpt; - ARegion *region = CTX_wm_region(C); Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); /* Dyntopo not supported. */ @@ -924,13 +914,12 @@ static int sculpt_face_sets_change_visibility_exec(bContext *C, wmOperator *op) MEM_SAFE_FREE(nodes); - ED_region_tag_redraw(region); - DEG_id_tag_update(&ob->id, ID_RECALC_SHADING); - - View3D *v3d = CTX_wm_view3d(C); - if (!BKE_sculptsession_use_pbvh_draw(ob, v3d)) { - DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); + if (BKE_pbvh_type(pbvh) == PBVH_FACES) { + BKE_mesh_flush_hidden_from_verts(ob->data); } + + SCULPT_tag_update_overlays(C); + return OPERATOR_FINISHED; } @@ -980,7 +969,6 @@ static int sculpt_face_sets_randomize_colors_exec(bContext *C, wmOperator *UNUSE Object *ob = CTX_data_active_object(C); SculptSession *ss = ob->sculpt; - ARegion *region = CTX_wm_region(C); /* Dyntopo not supported. */ if (BKE_pbvh_type(ss->pbvh) == PBVH_BMESH) { @@ -1008,13 +996,7 @@ static int sculpt_face_sets_randomize_colors_exec(bContext *C, wmOperator *UNUSE MEM_SAFE_FREE(nodes); - View3D *v3d = CTX_wm_view3d(C); - if (!BKE_sculptsession_use_pbvh_draw(ob, v3d)) { - DEG_id_tag_update(&ob->id, ID_RECALC_SHADING); - } - - ED_region_tag_redraw(region); - WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); + SCULPT_tag_update_overlays(C); return OPERATOR_FINISHED; } @@ -1139,7 +1121,6 @@ static int sculpt_face_set_edit_invoke(bContext *C, wmOperator *op, const wmEven { Object *ob = CTX_data_active_object(C); SculptSession *ss = ob->sculpt; - ARegion *region = CTX_wm_region(C); Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); const int mode = RNA_enum_get(op->ptr, "mode"); @@ -1198,13 +1179,7 @@ static int sculpt_face_set_edit_invoke(bContext *C, wmOperator *op, const wmEven BKE_mesh_flush_hidden_from_verts(ob->data); } - ED_region_tag_redraw(region); - DEG_id_tag_update(&ob->id, ID_RECALC_SHADING); - - View3D *v3d = CTX_wm_view3d(C); - if (!BKE_sculptsession_use_pbvh_draw(ob, v3d)) { - DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); - } + SCULPT_tag_update_overlays(C); return OPERATOR_FINISHED; } |