diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-21 18:29:58 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-23 10:47:13 +0300 |
commit | fec9615ea06c94b5224c14479c31c55c567fb7ee (patch) | |
tree | 3193277e063be03ad7218fecd778735f673686ea /source/blender/editors/mask/mask_select.c | |
parent | 1d48fa2206934688a4c1b303279c26b3a8d1a5ec (diff) |
Masks: Properly port to Copy-on-Write concept
Masks were not really covered by Copy-on-Write due to mistake
in the dependency graph. After correcting that mistake a lot
of tools became broken, so majority of the patch is related
on making it so access to evaluated/tessellated masks is done.
When accessing evaluated mask state make sure access to an
evaluated dependency graph is done. This solves possible
access to NULL data on redo.
Fixes T64899: Re-doing new point addition causes crash
Reviewers: brecht
Reviewed By: brecht
Maniphest Tasks: T64899
Differential Revision: https://developer.blender.org/D4918
Diffstat (limited to 'source/blender/editors/mask/mask_select.c')
-rw-r--r-- | source/blender/editors/mask/mask_select.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c index a592f39d24b..717ce9fd72e 100644 --- a/source/blender/editors/mask/mask_select.c +++ b/source/blender/editors/mask/mask_select.c @@ -43,6 +43,8 @@ #include "RNA_access.h" #include "RNA_define.h" +#include "DEG_depsgraph.h" + #include "mask_intern.h" /* own include */ /* -------------------------------------------------------------------- */ @@ -223,6 +225,7 @@ static int select_all_exec(bContext *C, wmOperator *op) ED_mask_select_toggle_all(mask, action); ED_mask_select_flush_all(mask); + DEG_id_tag_update(&mask->id, ID_RECALC_SELECT); WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask); return OPERATOR_FINISHED; @@ -326,6 +329,7 @@ static int select_exec(bContext *C, wmOperator *op) ED_mask_select_flush_all(mask); + DEG_id_tag_update(&mask->id, ID_RECALC_SELECT); WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask); return OPERATOR_FINISHED; @@ -365,6 +369,7 @@ static int select_exec(bContext *C, wmOperator *op) ED_mask_select_flush_all(mask); + DEG_id_tag_update(&mask->id, ID_RECALC_SELECT); WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask); return OPERATOR_FINISHED; @@ -374,6 +379,7 @@ static int select_exec(bContext *C, wmOperator *op) ED_mask_select_flush_all(mask); + DEG_id_tag_update(&mask->id, ID_RECALC_SELECT); WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask); return OPERATOR_FINISHED; @@ -488,6 +494,7 @@ static int box_select_exec(bContext *C, wmOperator *op) if (changed) { ED_mask_select_flush_all(mask); + DEG_id_tag_update(&mask->id, ID_RECALC_SELECT); WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask); return OPERATOR_FINISHED; @@ -592,6 +599,7 @@ static bool do_lasso_select_mask(bContext *C, if (changed) { ED_mask_select_flush_all(mask); + DEG_id_tag_update(&mask->id, ID_RECALC_SELECT); WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask); } @@ -719,6 +727,7 @@ static int circle_select_exec(bContext *C, wmOperator *op) if (changed) { ED_mask_select_flush_all(mask); + DEG_id_tag_update(&mask->id, ID_RECALC_SELECT); WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask); return OPERATOR_FINISHED; @@ -783,6 +792,7 @@ static int mask_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmE if (changed) { ED_mask_select_flush_all(mask); + DEG_id_tag_update(&mask->id, ID_RECALC_SELECT); WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask); return OPERATOR_FINISHED; @@ -840,6 +850,7 @@ static int mask_select_linked_exec(bContext *C, wmOperator *UNUSED(op)) if (changed) { ED_mask_select_flush_all(mask); + DEG_id_tag_update(&mask->id, ID_RECALC_SELECT); WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask); return OPERATOR_FINISHED; @@ -940,6 +951,7 @@ static int mask_select_more_less(bContext *C, bool more) } } + DEG_id_tag_update(&mask->id, ID_RECALC_SELECT); WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask); return OPERATOR_FINISHED; |