Fix uilists showing data names translated (reported on bf-translations ML by Satoshi...
[blender.git] / release / scripts / startup / bl_ui / properties_mask_common.py
index 7cd2ae0b5095ee6e8a1fb93bc64557402efefb85..4ceaffbaf8dc111cdc54737e8ca0e56f6f76ebf2 100644 (file)
 # 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(text=mask.name, translate=False, 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(text="", icon_value=icon)
 
 
 class MASK_PT_mask:
@@ -69,7 +87,7 @@ class MASK_PT_layers:
         rows = 5 if active_layer else 2
 
         row = layout.row()
-        row.template_list(mask, "layers",
+        row.template_list("MASK_UL_layers", "", mask, "layers",
                           mask, "active_layer_index", rows=rows)
 
         sub = row.column(align=True)
@@ -121,6 +139,7 @@ class MASK_PT_spline():
         spline = mask.layers.active.splines.active
 
         col = layout.column()
+        col.prop(spline, "offset_mode")
         col.prop(spline, "weight_interpolation")
 
         row = col.row()
@@ -223,7 +242,7 @@ class MASK_PT_tools():
         col.operator("transform.translate")
         col.operator("transform.rotate")
         col.operator("transform.resize", text="Scale")
-        props = col.operator("transform.transform", text="Shrink/Fatten")
+        props = col.operator("transform.transform", text="Scale Feather")
         props.mode = 'MASK_SHRINKFATTEN'
 
         col = layout.column(align=True)
@@ -237,6 +256,13 @@ class MASK_PT_tools():
         col.operator("mask.parent_set")
         col.operator("mask.parent_clear")
 
+        col = layout.column(align=True)
+        col.label(text="Animation:")
+        col.operator("mask.shape_key_clear")
+        col.operator("mask.shape_key_insert")
+        col.operator("mask.shape_key_feather_reset")
+        col.operator("mask.shape_key_rekey")
+
 
 class MASK_MT_mask(Menu):
     bl_label = "Mask"
@@ -284,7 +310,7 @@ class MASK_MT_transform(Menu):
         layout.operator("transform.translate")
         layout.operator("transform.rotate")
         layout.operator("transform.resize")
-        props = layout.operator("transform.transform", text="Shrink/Fatten")
+        props = layout.operator("transform.transform", text="Scale Feather")
         props.mode = 'MASK_SHRINKFATTEN'