diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-03-22 09:58:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-03-22 10:04:12 +0300 |
commit | 958e3a8cc12032343f4ffd18cf1ffcf7d7fd9bd2 (patch) | |
tree | 782609c22187e452fbce6e8fcb301fa6fe0eaadc /source/blender/gpencil_modifiers | |
parent | cb521bd37b26d069cfefec9683312e27c4caae90 (diff) |
RNA: use boolean array for transarency masks
There is no need to expose this as multiple properties,
also use `use_` prefix for boolean properties.
Diffstat (limited to 'source/blender/gpencil_modifiers')
-rw-r--r-- | source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c index 26af78e682f..6054111cfbf 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c @@ -357,18 +357,16 @@ static void transparency_panel_draw(const bContext *UNUSED(C), Panel *panel) uiLayout *row = uiLayoutRow(layout, true); uiLayoutSetPropDecorate(row, false); uiLayout *sub = uiLayoutRow(row, true); - uiItemR(sub, ptr, "transparency_mask_0", UI_ITEM_R_TOGGLE, IFACE_("0"), ICON_NONE); - uiItemR(sub, ptr, "transparency_mask_1", UI_ITEM_R_TOGGLE, IFACE_("1"), ICON_NONE); - uiItemR(sub, ptr, "transparency_mask_2", UI_ITEM_R_TOGGLE, IFACE_("2"), ICON_NONE); - uiItemR(sub, ptr, "transparency_mask_3", UI_ITEM_R_TOGGLE, IFACE_("3"), ICON_NONE); - uiItemR(sub, ptr, "transparency_mask_4", UI_ITEM_R_TOGGLE, IFACE_("4"), ICON_NONE); - uiItemR(sub, ptr, "transparency_mask_5", UI_ITEM_R_TOGGLE, IFACE_("5"), ICON_NONE); - uiItemR(sub, ptr, "transparency_mask_6", UI_ITEM_R_TOGGLE, IFACE_("6"), ICON_NONE); - uiItemR(sub, ptr, "transparency_mask_7", UI_ITEM_R_TOGGLE, IFACE_("7"), ICON_NONE); + char text[2] = "0"; + + PropertyRNA *prop = RNA_struct_find_property(ptr, "use_transparency_mask"); + for (int i = 0; i < 8; i++, text[0]++) { + uiItemFullR(sub, ptr, prop, i, 0, UI_ITEM_R_TOGGLE, text, ICON_NONE); + } uiItemL(row, "", ICON_BLANK1); /* Space for decorator. */ uiLayout *col = uiLayoutColumn(layout, true); - uiItemR(col, ptr, "transparency_match", 0, IFACE_("Match All Masks"), ICON_NONE); + uiItemR(col, ptr, "use_transparency_match", 0, IFACE_("Match All Masks"), ICON_NONE); } static void chaining_panel_draw(const bContext *UNUSED(C), Panel *panel) |