UI:
[blender-staging.git] / release / ui / buttons_material.py
index b7703bca94eaa4c76674ba8ffa004faf58d97c09..124fba83608c9ea136fa9292200eda4ac92463c3 100644 (file)
@@ -13,6 +13,9 @@ class MATERIAL_PT_preview(MaterialButtonsPanel):
        __idname__= "MATERIAL_PT_preview"
        __label__ = "Preview"
 
+       def poll(self, context):
+               return (context.material or context.material_slot)
+
        def draw(self, context):
                layout = self.layout
                mat = context.material
@@ -24,7 +27,7 @@ class MATERIAL_PT_material(MaterialButtonsPanel):
        __label__ = "Material"
 
        def poll(self, context):
-               return (context.object != None)
+               return (context.material or context.material_slot)
 
        def draw(self, context):
                layout = self.layout
@@ -419,4 +422,4 @@ bpy.types.register(MATERIAL_PT_raytransp)
 bpy.types.register(MATERIAL_PT_sss)
 bpy.types.register(MATERIAL_PT_halo)
 bpy.types.register(MATERIAL_PT_strand)
-bpy.types.register(MATERIAL_PT_options)
\ No newline at end of file
+bpy.types.register(MATERIAL_PT_options)