SHARE
TWEET

Untitled

a guest Jun 19th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class MATERIAL_UL_ob_matslot(bpy.types.UIList):
  2.  
  3.     def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
  4.         ob = data
  5.         slot = item
  6.         ma = slot.material
  7.  
  8.         if self.layout_type in {'DEFAULT', 'COMPACT'}:
  9.             if ma:              
  10.                 layout.prop(ma, "name", text= "", emboss=False, icon_value=icon)
  11.             else:              
  12.                 layout.label(text="", translate=False, icon_value=icon)
  13.         elif self.layout_type in {'GRID'}:
  14.  
  15.             layout.alignment = 'CENTER'
  16.             layout.label(text="", icon_value=icon)
  17.      
  18. layout.template_list("MATERIAL_UL_my_matslot", "", obj, "material_slots", obj, "active_material_index")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top