[Bf-blender-cvs] [00c54fb23a1] greasepencil-object: Cleanup: Material Buttons for GP

Joshua Leung noreply at git.blender.org
Tue May 1 19:13:05 CEST 2018


Commit: 00c54fb23a1d15e39001b6d21ef845917fb7611d
Author: Joshua Leung
Date:   Tue May 1 17:47:47 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB00c54fb23a1d15e39001b6d21ef845917fb7611d

Cleanup: Material Buttons for GP

* Don't collapse panels by default
* Cleanup old code/names/etc.

===================================================================

M	release/scripts/startup/bl_ui/properties_material_gpencil.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py b/release/scripts/startup/bl_ui/properties_material_gpencil.py
index 7e6fc1f52ad..acabe352d55 100644
--- a/release/scripts/startup/bl_ui/properties_material_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py
@@ -22,7 +22,6 @@ from bpy.types import Panel, UIList
 
 
 class GPENCIL_UL_matslots(UIList):
-
     def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
         slot = item
         ma = slot.material
@@ -55,7 +54,7 @@ class GPENCIL_UL_matslots(UIList):
 
 
 class MATERIAL_PT_gpencil_slots(Panel):
-    bl_label = "Palette Slots"
+    bl_label = "Grease Pencil Material Slots"
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "material"
@@ -123,11 +122,11 @@ class MATERIAL_PT_gpencil_strokecolor(Panel):
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "material"
-    bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
     def poll(cls, context):
-        return context.object and context.object.type == 'GPENCIL' and context.object.active_material
+        ob = context.object
+        return ob and ob.type == 'GPENCIL' and ob.active_material
 
     @staticmethod
     def draw(self, context):
@@ -175,11 +174,11 @@ class MATERIAL_PT_gpencil_fillcolor(Panel):
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "material"
-    bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
     def poll(cls, context):
-        return context.object and context.object.type == 'GPENCIL' and context.object.active_material
+        ob = context.object
+        return ob and ob.type == 'GPENCIL' and ob.active_material
  
     @staticmethod
     def draw(self, context):



More information about the Bf-blender-cvs mailing list