Commit: 32d6fc5ba5063e1ee472f226dbd02eb4f2266d97
Author: Antonio Vazquez
Date:   Wed Feb 12 10:03:56 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rB32d6fc5ba5063e1ee472f226dbd02eb4f2266d97

GPencil: Put Mask hide icon in RNA and not in python

Now the icon is associated to RNA property and don't need python code to handle 
it.

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

M       release/scripts/startup/bl_ui/properties_grease_pencil_common.py
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 1f26242149a..8f97128b280 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -776,8 +776,7 @@ class GPENCIL_UL_masks(UIList):
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
             row = layout.row(align=True)
             row.prop(mask, "name", text="", emboss=False, icon_value=icon)
-            icon_mask = 'HOLDOUT_ON' if mask.invert else 'HOLDOUT_OFF'
-            row.prop(mask, "invert", text="", emboss=False, icon=icon_mask)
+            row.prop(mask, "invert", text="", emboss=False)
             row.prop(mask, "hide", text="", emboss=False)
         elif self.layout_type == 'GRID':
             layout.alignment = 'CENTER'
diff --git a/source/blender/makesrna/intern/rna_gpencil.c 
b/source/blender/makesrna/intern/rna_gpencil.c
index 3666683a4ed..ed135d3ae25 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -1696,6 +1696,7 @@ static void rna_def_gpencil_layer_mask(BlenderRNA *brna)
 
   prop = RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_MASK_INVERT);
+  RNA_def_property_ui_icon(prop, ICON_HOLDOUT_OFF, 1);
   RNA_def_property_ui_text(prop, "Invert", "Invert mask");
   RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
 }

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

Reply via email to