Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-02-11 12:53:04 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-02-11 12:53:04 +0300
commit2954aa4c3be2bb0a63a8436fd1ac6b4a35a00d5a (patch)
treede730daf5ce7bf2cd556b2cc029eacb30e3e3b1e
parent7763b8fe79227417a815ac99400aa1a452e5a2b0 (diff)
GPencil: Add limit control for number of masking layers
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index 43879eef5e2..fb528678f94 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -3329,6 +3329,11 @@ static int gp_layer_mask_add_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
+ if (gpl_active->act_mask == 256) {
+ BKE_report(op->reports, RPT_ERROR, "Maximum number of masking layers reached");
+ return OPERATOR_CANCELLED;
+ }
+
bGPDlayer_Mask *mask = MEM_callocN(sizeof(bGPDlayer_Mask), "bGPDlayer_Mask");
BLI_addtail(&gpl_active->mask_layers, mask);
BLI_strncpy(mask->name, name, sizeof(mask->name));