diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-20 20:26:41 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-20 20:28:56 +0300 |
commit | 09ea940e7ba8c4905e692134dfc14d0a6fbf909b (patch) | |
tree | e75df71a192f2bb307b7938014263f5b2197a4e2 /release | |
parent | 1a0181bb6d94252fb4e4873eca8cdedc69c348be (diff) |
Fix missing Eevee volume panel in material tab.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_material.py | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index 706ce497dee..d843387720d 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -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, |