diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_mask_common.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_mask_common.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/properties_mask_common.py b/release/scripts/startup/bl_ui/properties_mask_common.py index 208b0a63075..9861db39f30 100644 --- a/release/scripts/startup/bl_ui/properties_mask_common.py +++ b/release/scripts/startup/bl_ui/properties_mask_common.py @@ -22,7 +22,24 @@ # menus are referenced `as is` import bpy -from bpy.types import Menu +from bpy.types import Menu, UIList + + +class MASK_UL_layers(UIList): + def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): + # assert(isinstance(item, bpy.types.MaskLayer) + mask = item + if self.layout_type in {'DEFAULT', 'COMPACT'}: + split = layout.split() + split.label(mask.name, icon_value=icon) + row = split.row(align=True) + row.prop(mask, "alpha", text="", emboss=False) + row.prop(mask, "hide", text="", emboss=False) + row.prop(mask, "hide_select", text="", emboss=False) + row.prop(mask, "hide_render", text="", emboss=False) + elif self.layout_type in {'GRID'}: + layout.alignment = 'CENTER' + layout.label("", icon_value=icon) class MASK_PT_mask: @@ -69,8 +86,7 @@ class MASK_PT_layers: rows = 5 if active_layer else 2 row = layout.row() - row.template_list(mask, "layers", - mask, "active_layer_index", rows=rows) + row.template_list("MASK_UL_layers", "", mask, "layers", mask, "active_layer_index", rows=rows) sub = row.column(align=True) |