Commit: 2954aa4c3be2bb0a63a8436fd1ac6b4a35a00d5a
Author: Antonio Vazquez
Date:   Tue Feb 11 10:53:04 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB2954aa4c3be2bb0a63a8436fd1ac6b4a35a00d5a

GPencil: Add limit control for number of masking layers

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

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 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));

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to