Commit: b47affbd75631b090c842b53ecde9626d2cf1f29 Author: Antonio Vazquez Date: Tue Feb 11 16:47:25 2020 +0100 Branches: greasepencil-refactor https://developer.blender.org/rBb47affbd75631b090c842b53ecde9626d2cf1f29
GPencil: Reset Mask list index when remove first element =================================================================== M source/blender/editors/gpencil/gpencil_data.c =================================================================== diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index a8e4947cda2..4d7c016fb94 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -3398,8 +3398,12 @@ static int gp_layer_mask_remove_exec(bContext *C, wmOperator *op) BLI_freelinkN(&gpl->mask_layers, mask); gpl->act_mask--; CLAMP_MIN(gpl->act_mask, 0); + if ((gpl->mask_layers.first != NULL) && (gpl->act_mask == 0)) { + gpl->act_mask = 1; + } } } + /* notifiers */ DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs