GPencil: Material panel is hidden after adding new material

This bug was introduced by previous Pin fix commit. Maybe it's not the best solution, but this bug is critical and need a quick fix.

This commit fix the problem, but not totally sure this is working fine with pin.

@dfelinto Could you review and adapt if required.
This commit is contained in:
Antonio Vazquez 2019-03-09 16:50:10 +01:00
parent 9c43520010
commit ba4d07cc5c
Notes: blender-bot 2023-02-14 05:44:22 +01:00
Referenced by issue #62384, Grease pencil blank material slot
1 changed files with 8 additions and 1 deletions

View File

@ -85,13 +85,20 @@ class GPMaterialButtonsPanel:
return ma and ma.grease_pencil
class MATERIAL_PT_gpencil_slots(GreasePencilMaterialsPanel, GPMaterialButtonsPanel, Panel):
class MATERIAL_PT_gpencil_slots(GreasePencilMaterialsPanel, Panel):
bl_label = "Grease Pencil Material Slots"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "material"
bl_options = {'HIDE_HEADER'}
@classmethod
def poll(cls, context):
ob = context.object
ma = context.material
return (ma and ma.grease_pencil) or (ob and ob.type == 'GPENCIL')
# Used as parent for "Stroke" and "Fill" panels
class MATERIAL_PT_gpencil_surface(GPMaterialButtonsPanel, Panel):