[Bf-blender-cvs] [12dfdd3dd01] greasepencil-refactor: GPencil: Back Mask Switch to 2 modes: ON/OFF

Antonio Vazquez noreply at git.blender.org
Sun Feb 9 18:17:51 CET 2020


Commit: 12dfdd3dd01a1bd46b0db329d09b9695847a3559
Author: Antonio Vazquez
Date:   Sun Feb 9 18:16:11 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB12dfdd3dd01a1bd46b0db329d09b9695847a3559

GPencil: Back Mask Switch to 2 modes: ON/OFF

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	source/blender/editors/animation/anim_channels_defines.c
M	source/blender/makesrna/intern/rna_gpencil.c

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

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 37cf1ad275f..76f498ed195 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -691,9 +691,7 @@ class GPENCIL_UL_layer(UIList):
 
             row = layout.row(align=True)
 
-            icon_mask = 'LAYER_ACTIVE'
-            if gpl.use_mask_layer:
-                icon_mask = 'HOLDOUT_ON' if gpl.invert_mask else 'MOD_MASK'
+            icon_mask = 'MOD_MASK' if gpl.use_mask_layer else 'LAYER_ACTIVE'
 
             row.prop(gpl, "use_mask_layer", text="", icon=icon_mask, emboss=False)
 
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 932f2893dec..a87465a0c7a 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -5096,12 +5096,10 @@ void ANIM_channel_draw_widgets(const bContext *C,
             if (RNA_path_resolve_property(&id_ptr, gp_rna_path, &ptr, &prop)) {
               icon = ICON_LAYER_ACTIVE;
               if (gpl->flag & GP_LAYER_USE_MASK) {
-                if (gpl->flag & GP_LAYER_MASK_INVERT) {
-                  icon = ICON_HOLDOUT_ON;
-                }
-                else {
-                  icon = ICON_MOD_MASK;
-                }
+                icon = ICON_MOD_MASK;
+              }
+              else {
+                icon = ICON_LAYER_ACTIVE;
               }
               uiDefAutoButR(block,
                             &ptr,
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 78714fbdb9a..3ab07f9626b 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -525,25 +525,6 @@ static void rna_GPencilLayer_mask_info_set(PointerRNA *ptr, const char *value)
   }
 }
 
-static void rna_GPencil_layer_mask_set(PointerRNA *ptr, const bool value)
-{
-  bGPDlayer *gpl = ptr->data;
-
-  const bool use_mask = gpl->flag & GP_LAYER_USE_MASK;
-
-  /* Cycle through the 3 options */
-  if (value != use_mask) {
-    if (use_mask && (gpl->flag & GP_LAYER_MASK_INVERT) == 0) {
-      /* Switch to invert mask instead of removing the masking. */
-      gpl->flag |= GP_LAYER_MASK_INVERT;
-    }
-    else {
-      SET_FLAG_FROM_TEST(gpl->flag, value, GP_LAYER_USE_MASK);
-      gpl->flag &= ~GP_LAYER_MASK_INVERT;
-    }
-  }
-}
-
 static bGPDstroke *rna_GPencil_stroke_point_find_stroke(const bGPdata *gpd,
                                                         const bGPDspoint *pt,
                                                         bGPDlayer **r_gpl,
@@ -1579,14 +1560,12 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
       prop, "Disallow Locked Materials Editing", "Avoids editing locked materials in the layer");
   RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
 
-#  /* TODO: ON/OFF */
   prop = RNA_def_property(srna, "use_mask_layer", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_USE_MASK);
   RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-  RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencil_layer_mask_set");
   RNA_def_property_ui_text(prop, "Mask Layer", "Mask pixels from underlying layers drawing");
   RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
-#
+
   prop = RNA_def_property(srna, "invert_mask", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_MASK_INVERT);
   RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);



More information about the Bf-blender-cvs mailing list