Fix missing Eevee volume panel in material tab.

This commit is contained in:
Brecht Van Lommel
2018-09-20 19:26:41 +02:00
parent 1a0181bb6d
commit 09ea940e7b

View File

@@ -141,11 +141,11 @@ class EEVEE_MATERIAL_PT_context_material(MaterialButtonsPanel, Panel):
row.template_ID(space, "pin_id")
def panel_node_draw(layout, ntree, output_type):
def panel_node_draw(layout, ntree, output_type, input_name):
node = ntree.get_output_node('EEVEE')
if node:
input = find_node_input(node, 'Surface')
input = find_node_input(node, input_name)
if input:
layout.template_node_view(ntree, node, input)
else:
@@ -173,7 +173,7 @@ class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel):
layout.separator()
if mat.use_nodes:
panel_node_draw(layout, mat.node_tree, 'OUTPUT_MATERIAL')
panel_node_draw(layout, mat.node_tree, 'OUTPUT_MATERIAL', 'Surface')
else:
layout.use_property_split = True
layout.prop(mat, "diffuse_color", text="Base Color")
@@ -182,6 +182,26 @@ class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel):
layout.prop(mat, "roughness")
class EEVEE_MATERIAL_PT_volume(MaterialButtonsPanel, Panel):
bl_label = "Volume"
bl_context = "material"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
engine = context.engine
mat = context.material
return mat and mat.use_nodes and (engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = context.material
panel_node_draw(layout, mat.node_tree, 'OUTPUT_MATERIAL', 'Volume')
class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
bl_label = "Options"
bl_context = "material"
@@ -242,6 +262,7 @@ classes = (
MATERIAL_PT_preview,
EEVEE_MATERIAL_PT_context_material,
EEVEE_MATERIAL_PT_surface,
EEVEE_MATERIAL_PT_volume,
EEVEE_MATERIAL_PT_options,
MATERIAL_PT_viewport,
MATERIAL_PT_custom_props,