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-09 20:16:11 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-02-09 20:16:44 +0300
commit12dfdd3dd01a1bd46b0db329d09b9695847a3559 (patch)
treece567fb826b39fb87ea7224ba1f837e8adde22e1
parentddd5d35fba0dc4c260802d3e224a391fd2230469 (diff)
GPencil: Back Mask Switch to 2 modes: ON/OFF
-rw-r--r--release/scripts/startup/bl_ui/properties_grease_pencil_common.py4
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c10
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c23
3 files changed, 6 insertions, 31 deletions
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);