diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2019-08-27 16:47:30 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2019-09-04 16:57:00 +0300 |
commit | 68d1f091583168dce4e52d3c7378b9b0359e903a (patch) | |
tree | 07adc7e5f8f353f4bab9f8cdd6f4fd783a13767c /release/scripts/startup/bl_ui/properties_material.py | |
parent | d3ab930c880e3a15cd7cd46355663e60119f6bde (diff) |
Shading Modes: Material and Render Preview
This change implements the basics as described in {T68312} for the
shading modes.
* LookDev shading mode is renamed to Material Preview. It always uses Eevee as renderer, and is intended to provide a fast material preview suitable for texture painting, and texture and material setup.
* Rendered shading gains "Use Scene Lights" and "Use Scene World" options similar to current Material Preview. These will be enabled by default. When Use Scene World is turned off, HDRIs will be used for lighting instead. These options are available for EEVEE and Cycles.
* Renderers will be able to customize the shading settings panel and add additional settings.
Reviewed By: brecht, fclem
Differential Revision: https://developer.blender.org/D5612
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_material.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_material.py | 51 |
1 files changed, 33 insertions, 18 deletions
diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index f3c34cf4660..0849437b680 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -202,33 +202,47 @@ class EEVEE_MATERIAL_PT_volume(MaterialButtonsPanel, Panel): panel_node_draw(layout, mat.node_tree, 'OUTPUT_MATERIAL', "Volume") +def draw_material_settings(self, context): + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False + + mat = context.material + + layout.prop(mat, "use_backface_culling") + layout.prop(mat, "blend_method") + layout.prop(mat, "shadow_method") + + row = layout.row() + row.active = ((mat.blend_method == 'CLIP') or (mat.shadow_method == 'CLIP')) + row.prop(mat, "alpha_threshold") + + if mat.blend_method not in {'OPAQUE', 'CLIP', 'HASHED'}: + layout.prop(mat, "show_transparent_back") + + layout.prop(mat, "use_screen_refraction") + layout.prop(mat, "refraction_depth") + layout.prop(mat, "use_sss_translucency") + layout.prop(mat, "pass_index") + + class EEVEE_MATERIAL_PT_settings(MaterialButtonsPanel, Panel): bl_label = "Settings" bl_context = "material" COMPAT_ENGINES = {'BLENDER_EEVEE'} def draw(self, context): - layout = self.layout - layout.use_property_split = True - layout.use_property_decorate = False - - mat = context.material - - layout.prop(mat, "use_backface_culling") - layout.prop(mat, "blend_method") - layout.prop(mat, "shadow_method") + draw_material_settings(self, context) - row = layout.row() - row.active = ((mat.blend_method == 'CLIP') or (mat.shadow_method == 'CLIP')) - row.prop(mat, "alpha_threshold") - if mat.blend_method not in {'OPAQUE', 'CLIP', 'HASHED'}: - layout.prop(mat, "show_transparent_back") +class EEVEE_MATERIAL_PT_viewport_settings(MaterialButtonsPanel, Panel): + bl_label = "Settings" + bl_context = "material" + bl_parent_id = "MATERIAL_PT_viewport" + COMPAT_ENGINES = {'BLENDER_RENDER'} - layout.prop(mat, "use_screen_refraction") - layout.prop(mat, "refraction_depth") - layout.prop(mat, "use_sss_translucency") - layout.prop(mat, "pass_index") + def draw(self, context): + draw_material_settings(self, context) class MATERIAL_PT_viewport(MaterialButtonsPanel, Panel): @@ -263,6 +277,7 @@ classes = ( EEVEE_MATERIAL_PT_volume, EEVEE_MATERIAL_PT_settings, MATERIAL_PT_viewport, + EEVEE_MATERIAL_PT_viewport_settings, MATERIAL_PT_custom_props, ) |