Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2018-04-19 18:34:44 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-04-19 18:35:25 +0300
commit51b796ff1528c52cc8b4079fab1003671652a4d9 (patch)
tree0dfc2d2dabe5e77959264f5b6667897569290a41 /release/scripts/startup/bl_ui/properties_material.py
parent785e8a636a293941a4295e669cb5aeecfafae039 (diff)
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually do it. Here it goes; Blender Internal. Bye bye, you did great! * Point density, voxel data, ocean, environment map textures were removed, as these only worked within BI rendering. Note that the ocean modifier and the Cycles point density shader node continue to work. * Dynamic paint using material shading was removed, as this only worked with BI. If we ever wanted to support this again probably it should go through the baking API. * GPU shader export through the Python API was removed. This only worked for the old BI GLSL shaders, which no longer exists. Doing something similar for Eevee would be significantly more complicated because it uses a lot of multiplass rendering and logic outside the shader, it's probably impractical. * Collada material import / export code is mostly gone, as it only worked for BI materials. We need to add Cycles / Eevee material support at some point. * The mesh noise operator was removed since it only worked with BI material texture slots. A displacement modifier can be used instead. * The delete texture paint slot operator was removed since it only worked for BI material texture slots. Could be added back with node support. * Not all legacy viewport features are supported in the new viewport, but their code was removed. If we need to bring anything back we can look at older git revisions. * There is some legacy viewport code that I could not remove yet, and some that I probably missed. * Shader node execution code was left mostly intact, even though it is not used anywhere now. We may eventually use this to replace the texture nodes with Cycles / Eevee shader nodes. * The Cycles Bake panel now includes settings for baking multires normal and displacement maps. The underlying code needs to be merged properly, and we plan to add back support for multires AO baking and add support to Cycles baking for features like vertex color, displacement, and other missing baking features. * This commit removes DNA and the Python API for BI material, lamp, world and scene settings. This breaks a lot of addons. * There is more DNA that can be removed or renamed, where Cycles or Eevee are reusing some old BI properties but the names are not really correct anymore. * Texture slots for materials, lamps and world were removed. They remain for brushes, particles and freestyle linestyles. * 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and other renderers use this to find all panels to show, minus a few panels that they have their own replacement for.
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_material.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_material.py909
1 files changed, 2 insertions, 907 deletions
diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py
index 233a1c4369e..13c783ad024 100644
--- a/release/scripts/startup/bl_ui/properties_material.py
+++ b/release/scripts/startup/bl_ui/properties_material.py
@@ -23,42 +23,6 @@ from rna_prop_ui import PropertyPanel
from bpy.app.translations import pgettext_iface as iface_
from bpy_extras.node_utils import find_node_input, find_output_node
-def active_node_mat(mat):
- # TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
- # which settings from node-materials are used
- if mat is not None:
- mat_node = mat.active_node_material
- if mat_node:
- return mat_node
- else:
- return mat
-
- return None
-
-
-def check_material(mat):
- if mat is not None:
- if mat.use_nodes:
- if mat.active_node_material is not None:
- return True
- return False
- return True
- return False
-
-
-def simple_material(mat):
- if (mat is not None) and (not mat.use_nodes):
- return True
- return False
-
-
-class MATERIAL_MT_sss_presets(Menu):
- bl_label = "SSS Presets"
- preset_subdir = "sss"
- preset_operator = "script.execute_preset"
- draw = Menu.draw_preset
-
-
class MATERIAL_MT_specials(Menu):
bl_label = "Material Specials"
@@ -82,12 +46,6 @@ class MATERIAL_UL_matslots(UIList):
layout.prop(ma, "name", text="", emboss=False, icon_value=icon)
else:
layout.label(text="", icon_value=icon)
- if ma and not context.scene.render.use_shading_nodes:
- manode = ma.active_node_material
- if manode:
- layout.label(text=iface_("Node %s") % manode.name, translate=False, icon_value=layout.icon(manode))
- elif ma.use_nodes:
- layout.label(text="Node <none>")
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.label(text="", icon_value=icon)
@@ -104,859 +62,16 @@ class MaterialButtonsPanel:
return context.material and (context.engine in cls.COMPAT_ENGINES)
-class MATERIAL_PT_context_material(MaterialButtonsPanel, Panel):
- bl_label = ""
- bl_options = {'HIDE_HEADER'}
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- @classmethod
- def poll(cls, context):
- # An exception, don't call the parent poll func because
- # this manages materials for all engine types
-
- engine = context.engine
- return (context.material or context.object) and (engine in cls.COMPAT_ENGINES)
-
- def draw(self, context):
- layout = self.layout
-
- mat = context.material
- ob = context.object
- slot = context.material_slot
- space = context.space_data
-
- if ob:
- is_sortable = (len(ob.material_slots) > 1)
-
- rows = 1
- if is_sortable:
- rows = 4
-
- row = layout.row()
-
- row.template_list("MATERIAL_UL_matslots", "", ob, "material_slots", ob, "active_material_index", rows=rows)
-
- col = row.column(align=True)
- col.operator("object.material_slot_add", icon='ZOOMIN', text="")
- col.operator("object.material_slot_remove", icon='ZOOMOUT', text="")
-
- col.menu("MATERIAL_MT_specials", icon='DOWNARROW_HLT', text="")
-
- if is_sortable:
- col.separator()
-
- col.operator("object.material_slot_move", icon='TRIA_UP', text="").direction = 'UP'
- col.operator("object.material_slot_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
-
- if ob.mode == 'EDIT':
- row = layout.row(align=True)
- row.operator("object.material_slot_assign", text="Assign")
- row.operator("object.material_slot_select", text="Select")
- row.operator("object.material_slot_deselect", text="Deselect")
-
- split = layout.split(percentage=0.65)
-
- if ob:
- split.template_ID(ob, "active_material", new="material.new")
- row = split.row()
- if mat:
- row.prop(mat, "use_nodes", icon='NODETREE', text="")
-
- if slot:
- row.prop(slot, "link", text="")
- else:
- row.label()
- elif mat:
- split.template_ID(space, "pin_id")
- split.separator()
-
- if mat:
- layout.row().prop(mat, "type", expand=True)
- if mat.use_nodes:
- row = layout.row()
- row.label(text="", icon='NODETREE')
- if mat.active_node_material:
- row.prop(mat.active_node_material, "name", text="")
- else:
- row.label(text="No material node selected")
-
-
class MATERIAL_PT_preview(MaterialButtonsPanel, Panel):
bl_label = "Preview"
- COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
+ COMPAT_ENGINES = {'BLENDER_EEVEE'}
def draw(self, context):
self.layout.template_preview(context.material)
-class MATERIAL_PT_pipeline(MaterialButtonsPanel, Panel):
- bl_label = "Render Pipeline Options"
- bl_options = {'DEFAULT_CLOSED'}
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- @classmethod
- def poll(cls, context):
- mat = context.material
- engine = context.engine
- return mat and (not simple_material(mat)) and (mat.type in {'SURFACE', 'WIRE', 'VOLUME'}) and (engine in cls.COMPAT_ENGINES)
-
- def draw(self, context):
- layout = self. layout
-
- mat = context.material
- mat_type = mat.type in {'SURFACE', 'WIRE'}
-
- row = layout.row()
- row.active = mat_type
- row.prop(mat, "use_transparency")
- sub = row.column()
- sub.prop(mat, "offset_z")
-
- sub.active = mat_type and mat.use_transparency and mat.transparency_method == 'Z_TRANSPARENCY'
-
- row = layout.row()
- row.active = mat.use_transparency or not mat_type
- row.prop(mat, "transparency_method", expand=True)
-
- layout.separator()
-
- split = layout.split()
- col = split.column()
-
- col.prop(mat, "use_raytrace")
- col.prop(mat, "use_full_oversampling")
- sub = col.column()
- sub.active = mat_type
- sub.prop(mat, "use_sky")
- sub.prop(mat, "invert_z")
- col.prop(mat, "pass_index")
-
- col = split.column()
- col.active = mat_type
-
- col.prop(mat, "use_cast_shadows", text="Cast")
- col.prop(mat, "use_cast_shadows_only", text="Cast Only")
- col.prop(mat, "use_cast_buffer_shadows")
- sub = col.column()
- sub.active = mat.use_cast_buffer_shadows
- sub.prop(mat, "shadow_cast_alpha", text="Casting Alpha")
- col.prop(mat, "use_cast_approximate")
-
-
-class MATERIAL_PT_diffuse(MaterialButtonsPanel, Panel):
- bl_label = "Diffuse"
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- @classmethod
- def poll(cls, context):
- mat = context.material
- engine = context.engine
- return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES)
-
- def draw(self, context):
- layout = self.layout
-
- mat = active_node_mat(context.material)
-
- split = layout.split()
-
- col = split.column()
- col.prop(mat, "diffuse_color", text="")
- sub = col.column()
- sub.active = (not mat.use_shadeless)
- sub.prop(mat, "diffuse_intensity", text="Intensity")
-
- col = split.column()
- col.active = (not mat.use_shadeless)
- col.prop(mat, "diffuse_shader", text="")
- col.prop(mat, "use_diffuse_ramp", text="Ramp")
-
- col = layout.column()
- col.active = (not mat.use_shadeless)
- if mat.diffuse_shader == 'OREN_NAYAR':
- col.prop(mat, "roughness")
- elif mat.diffuse_shader == 'MINNAERT':
- col.prop(mat, "darkness")
- elif mat.diffuse_shader == 'TOON':
- row = col.row()
- row.prop(mat, "diffuse_toon_size", text="Size")
- row.prop(mat, "diffuse_toon_smooth", text="Smooth")
- elif mat.diffuse_shader == 'FRESNEL':
- row = col.row()
- row.prop(mat, "diffuse_fresnel", text="Fresnel")
- row.prop(mat, "diffuse_fresnel_factor", text="Factor")
-
- if mat.use_diffuse_ramp:
- col = layout.column()
- col.active = (not mat.use_shadeless)
- col.separator()
- col.template_color_ramp(mat, "diffuse_ramp", expand=True)
- col.separator()
-
- row = col.row()
- row.prop(mat, "diffuse_ramp_input", text="Input")
- row.prop(mat, "diffuse_ramp_blend", text="Blend")
-
- col.prop(mat, "diffuse_ramp_factor", text="Factor")
-
-
-class MATERIAL_PT_specular(MaterialButtonsPanel, Panel):
- bl_label = "Specular"
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- @classmethod
- def poll(cls, context):
- mat = context.material
- engine = context.engine
- return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES)
-
- def draw(self, context):
- layout = self.layout
-
- mat = active_node_mat(context.material)
-
- layout.active = (not mat.use_shadeless)
-
- split = layout.split()
-
- col = split.column()
- col.prop(mat, "specular_color", text="")
- col.prop(mat, "specular_intensity", text="Intensity")
-
- col = split.column()
- col.prop(mat, "specular_shader", text="")
- col.prop(mat, "use_specular_ramp", text="Ramp")
-
- col = layout.column()
- if mat.specular_shader in {'COOKTORR', 'PHONG'}:
- col.prop(mat, "specular_hardness", text="Hardness")
- elif mat.specular_shader == 'BLINN':
- row = col.row()
- row.prop(mat, "specular_hardness", text="Hardness")
- row.prop(mat, "specular_ior", text="IOR")
- elif mat.specular_shader == 'WARDISO':
- col.prop(mat, "specular_slope", text="Slope")
- elif mat.specular_shader == 'TOON':
- row = col.row()
- row.prop(mat, "specular_toon_size", text="Size")
- row.prop(mat, "specular_toon_smooth", text="Smooth")
-
- if mat.use_specular_ramp:
- layout.separator()
- layout.template_color_ramp(mat, "specular_ramp", expand=True)
- layout.separator()
-
- row = layout.row()
- row.prop(mat, "specular_ramp_input", text="Input")
- row.prop(mat, "specular_ramp_blend", text="Blend")
-
- layout.prop(mat, "specular_ramp_factor", text="Factor")
-
-
-class MATERIAL_PT_shading(MaterialButtonsPanel, Panel):
- bl_label = "Shading"
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- @classmethod
- def poll(cls, context):
- mat = context.material
- engine = context.engine
- return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES)
-
- def draw(self, context):
- layout = self.layout
-
- mat = active_node_mat(context.material)
-
- if mat.type in {'SURFACE', 'WIRE'}:
- split = layout.split()
-
- col = split.column()
- sub = col.column()
- sub.active = not mat.use_shadeless
- sub.prop(mat, "emit")
- sub.prop(mat, "ambient")
- sub = col.column()
- sub.prop(mat, "translucency")
-
- col = split.column()
- col.prop(mat, "use_shadeless")
- sub = col.column()
- sub.active = not mat.use_shadeless
- sub.prop(mat, "use_tangent_shading")
- sub.prop(mat, "use_cubic")
-
-
-class MATERIAL_PT_transp(MaterialButtonsPanel, Panel):
- bl_label = "Transparency"
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- @classmethod
- def poll(cls, context):
- mat = context.material
- engine = context.engine
- return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES)
-
- def draw_header(self, context):
- mat = context.material
-
- if simple_material(mat):
- self.layout.prop(mat, "use_transparency", text="")
-
- def draw(self, context):
- layout = self.layout
-
- base_mat = context.material
- mat = active_node_mat(context.material)
- rayt = mat.raytrace_transparency
-
- if simple_material(base_mat):
- row = layout.row()
- row.active = mat.use_transparency
- row.prop(mat, "transparency_method", expand=True)
-
- split = layout.split()
- split.active = base_mat.use_transparency
-
- col = split.column()
- col.prop(mat, "alpha")
- row = col.row()
- row.active = (base_mat.transparency_method != 'MASK') and (not mat.use_shadeless)
- row.prop(mat, "specular_alpha", text="Specular")
-
- col = split.column()
- col.active = (not mat.use_shadeless)
- col.prop(rayt, "fresnel")
- sub = col.column()
- sub.active = (rayt.fresnel > 0.0)
- sub.prop(rayt, "fresnel_factor", text="Blend")
-
- if base_mat.transparency_method == 'RAYTRACE':
- layout.separator()
- split = layout.split()
- split.active = base_mat.use_transparency
-
- col = split.column()
- col.prop(rayt, "ior")
- col.prop(rayt, "filter")
- col.prop(rayt, "falloff")
- col.prop(rayt, "depth_max")
- col.prop(rayt, "depth")
-
- col = split.column()
- col.label(text="Gloss:")
- col.prop(rayt, "gloss_factor", text="Amount")
- sub = col.column()
- sub.active = rayt.gloss_factor < 1.0
- sub.prop(rayt, "gloss_threshold", text="Threshold")
- sub.prop(rayt, "gloss_samples", text="Samples")
-
-
-class MATERIAL_PT_mirror(MaterialButtonsPanel, Panel):
- bl_label = "Mirror"
- bl_options = {'DEFAULT_CLOSED'}
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- @classmethod
- def poll(cls, context):
- mat = context.material
- engine = context.engine
- return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES)
-
- def draw_header(self, context):
- raym = active_node_mat(context.material).raytrace_mirror
-
- self.layout.prop(raym, "use", text="")
-
- def draw(self, context):
- layout = self.layout
-
- mat = active_node_mat(context.material)
- raym = mat.raytrace_mirror
-
- layout.active = raym.use
-
- split = layout.split()
-
- col = split.column()
- col.prop(raym, "reflect_factor")
- col.prop(mat, "mirror_color", text="")
-
- col = split.column()
- col.prop(raym, "fresnel")
- sub = col.column()
- sub.active = (raym.fresnel > 0.0)
- sub.prop(raym, "fresnel_factor", text="Blend")
-
- split = layout.split()
-
- col = split.column()
- col.separator()
- col.prop(raym, "depth")
- col.prop(raym, "distance", text="Max Dist")
- col.separator()
- sub = col.split(percentage=0.4)
- sub.active = (raym.distance > 0.0)
- sub.label(text="Fade To:")
- sub.prop(raym, "fade_to", text="")
-
- col = split.column()
- col.label(text="Gloss:")
- col.prop(raym, "gloss_factor", text="Amount")
- sub = col.column()
- sub.active = (raym.gloss_factor < 1.0)
- sub.prop(raym, "gloss_threshold", text="Threshold")
- sub.prop(raym, "gloss_samples", text="Samples")
- sub.prop(raym, "gloss_anisotropic", text="Anisotropic")
-
-
-class MATERIAL_PT_sss(MaterialButtonsPanel, Panel):
- bl_label = "Subsurface Scattering"
- bl_options = {'DEFAULT_CLOSED'}
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- @classmethod
- def poll(cls, context):
- mat = context.material
- engine = context.engine
- return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES)
-
- def draw_header(self, context):
- mat = active_node_mat(context.material)
- sss = mat.subsurface_scattering
-
- self.layout.active = (not mat.use_shadeless)
- self.layout.prop(sss, "use", text="")
-
- def draw(self, context):
- layout = self.layout
-
- mat = active_node_mat(context.material)
- sss = mat.subsurface_scattering
-
- layout.active = (sss.use) and (not mat.use_shadeless)
-
- row = layout.row().split()
- sub = row.row(align=True).split(align=True, percentage=0.75)
- sub.menu("MATERIAL_MT_sss_presets", text=bpy.types.MATERIAL_MT_sss_presets.bl_label)
- sub.operator("material.sss_preset_add", text="", icon='ZOOMIN')
- sub.operator("material.sss_preset_add", text="", icon='ZOOMOUT').remove_active = True
-
- split = layout.split()
-
- col = split.column()
- col.prop(sss, "ior")
- col.prop(sss, "scale")
- col.prop(sss, "color", text="")
- col.prop(sss, "radius", text="RGB Radius", expand=True)
-
- col = split.column()
- sub = col.column(align=True)
- sub.label(text="Blend:")
- sub.prop(sss, "color_factor", text="Color")
- sub.prop(sss, "texture_factor", text="Texture")
- sub.label(text="Scattering Weight:")
- sub.prop(sss, "front")
- sub.prop(sss, "back")
- col.separator()
- col.prop(sss, "error_threshold", text="Error")
-
-
-class MATERIAL_PT_halo(MaterialButtonsPanel, Panel):
- bl_label = "Halo"
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- @classmethod
- def poll(cls, context):
- mat = context.material
- engine = context.engine
- return mat and (mat.type == 'HALO') and (engine in cls.COMPAT_ENGINES)
-
- def draw(self, context):
- layout = self.layout
-
- mat = context.material # don't use node material
- halo = mat.halo
-
- def number_but(layout, toggle, number, name, color):
- row = layout.row(align=True)
- row.prop(halo, toggle, text="")
- sub = row.column(align=True)
- sub.active = getattr(halo, toggle)
- sub.prop(halo, number, text=name, translate=False)
- if not color == "":
- sub.prop(mat, color, text="")
-
- split = layout.split()
-
- col = split.column()
- col.prop(mat, "alpha")
- col.prop(mat, "diffuse_color", text="")
- col.prop(halo, "seed")
-
- col = split.column()
- col.prop(halo, "size")
- col.prop(halo, "hardness")
- col.prop(halo, "add")
-
- layout.label(text="Options:")
-
- split = layout.split()
- col = split.column()
- col.prop(halo, "use_texture")
- col.prop(halo, "use_vertex_normal")
- col.prop(halo, "use_extreme_alpha")
- col.prop(halo, "use_shaded")
- col.prop(halo, "use_soft")
-
- col = split.column()
- number_but(col, "use_ring", "ring_count", iface_("Rings"), "mirror_color")
- number_but(col, "use_lines", "line_count", iface_("Lines"), "specular_color")
- number_but(col, "use_star", "star_tip_count", iface_("Star Tips"), "")
-
-
-class MATERIAL_PT_flare(MaterialButtonsPanel, Panel):
- bl_label = "Flare"
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- @classmethod
- def poll(cls, context):
- mat = context.material
- engine = context.engine
- return mat and (mat.type == 'HALO') and (engine in cls.COMPAT_ENGINES)
-
- def draw_header(self, context):
- halo = context.material.halo
-
- self.layout.prop(halo, "use_flare_mode", text="")
-
- def draw(self, context):
- layout = self.layout
-
- mat = context.material # don't use node material
- halo = mat.halo
-
- layout.active = halo.use_flare_mode
-
- split = layout.split()
-
- col = split.column()
- col.prop(halo, "flare_size", text="Size")
- col.prop(halo, "flare_boost", text="Boost")
- col.prop(halo, "flare_seed", text="Seed")
-
- col = split.column()
- col.prop(halo, "flare_subflare_count", text="Subflares")
- col.prop(halo, "flare_subflare_size", text="Subsize")
-
-
-class MATERIAL_PT_strand(MaterialButtonsPanel, Panel):
- bl_label = "Strand"
- bl_options = {'DEFAULT_CLOSED'}
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- @classmethod
- def poll(cls, context):
- mat = context.material
- engine = context.engine
- return mat and (mat.type in {'SURFACE', 'WIRE', 'HALO'}) and (engine in cls.COMPAT_ENGINES)
-
- def draw(self, context):
- layout = self.layout
-
- mat = context.material # don't use node material
- tan = mat.strand
-
- split = layout.split()
-
- col = split.column()
- sub = col.column(align=True)
- sub.label(text="Size:")
- sub.prop(tan, "root_size", text="Root")
- sub.prop(tan, "tip_size", text="Tip")
- sub.prop(tan, "size_min", text="Minimum")
- sub.prop(tan, "use_blender_units")
- sub = col.column()
- sub.active = (not mat.use_shadeless)
- sub.prop(tan, "use_tangent_shading")
- col.prop(tan, "shape")
-
- col = split.column()
- col.label(text="Shading:")
- col.prop(tan, "width_fade")
- ob = context.object
- if ob and ob.type == 'MESH':
- col.prop_search(tan, "uv_layer", ob.data, "uv_layers", text="")
- else:
- col.prop(tan, "uv_layer", text="")
- col.separator()
- sub = col.column()
- sub.active = (not mat.use_shadeless)
- sub.label("Surface diffuse:")
- sub = col.column()
- sub.prop(tan, "blend_distance", text="Distance")
-
-
-class MATERIAL_PT_options(MaterialButtonsPanel, Panel):
- bl_label = "Options"
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- @classmethod
- def poll(cls, context):
- mat = context.material
- engine = context.engine
- return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES)
-
- def draw(self, context):
- layout = self.layout
-
- base_mat = context.material
- mat = active_node_mat(base_mat)
-
- split = layout.split()
-
- col = split.column()
- if simple_material(base_mat):
- col.prop(mat, "use_raytrace")
- col.prop(mat, "use_full_oversampling")
- col.prop(mat, "use_sky")
- col.prop(mat, "use_mist")
- if simple_material(base_mat):
- col.prop(mat, "invert_z")
- sub = col.row()
- sub.prop(mat, "offset_z")
- sub.active = mat.use_transparency and mat.transparency_method == 'Z_TRANSPARENCY'
- sub = col.column(align=True)
- sub.label(text="Light Group:")
- sub.prop(mat, "light_group", text="")
- row = sub.row(align=True)
- row.active = bool(mat.light_group)
- row.prop(mat, "use_light_group_exclusive", text="Exclusive")
- row.prop(mat, "use_light_group_local", text="Local")
-
- col = split.column()
- col.prop(mat, "use_vertex_color_paint")
- col.prop(mat, "use_vertex_color_light")
- col.prop(mat, "use_object_color")
- col.prop(mat, "use_uv_project")
- if simple_material(base_mat):
- col.prop(mat, "pass_index")
-
- col.label("Edit Image")
- col.template_ID(mat, "edit_image")
-
-
-class MATERIAL_PT_shadow(MaterialButtonsPanel, Panel):
- bl_label = "Shadow"
- bl_options = {'DEFAULT_CLOSED'}
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- @classmethod
- def poll(cls, context):
- mat = context.material
- engine = context.engine
- return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES)
-
- def draw(self, context):
- layout = self.layout
-
- base_mat = context.material
- mat = active_node_mat(base_mat)
-
- split = layout.split()
-
- col = split.column()
- col.prop(mat, "use_shadows", text="Receive")
- col.prop(mat, "use_transparent_shadows", text="Receive Transparent")
- col.prop(mat, "use_only_shadow", text="Shadows Only")
- sub = col.column()
- sub.active = mat.use_only_shadow
- sub.prop(mat, "shadow_only_type", text="")
-
- if not simple_material(base_mat):
- col = split.column()
-
- col.prop(mat, "use_ray_shadow_bias", text="Auto Ray Bias")
- sub = col.column()
- sub.active = (not mat.use_ray_shadow_bias)
- sub.prop(mat, "shadow_ray_bias", text="Ray Bias")
-
- if simple_material(base_mat):
- col = split.column()
-
- col.prop(mat, "use_cast_shadows", text="Cast")
- col.prop(mat, "use_cast_shadows_only", text="Cast Only")
- col.prop(mat, "use_cast_buffer_shadows")
- sub = col.column()
- sub.active = mat.use_cast_buffer_shadows
- if simple_material(base_mat):
- sub.prop(mat, "shadow_cast_alpha", text="Casting Alpha")
- sub.prop(mat, "shadow_buffer_bias", text="Buffer Bias")
- if simple_material(base_mat):
- col.prop(mat, "use_cast_approximate")
-
-
-class VolumeButtonsPanel:
- bl_space_type = 'PROPERTIES'
- bl_region_type = 'WINDOW'
- bl_context = "material"
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- @classmethod
- def poll(cls, context):
- mat = context.material
- engine = context.engine
- return mat and (mat.type == 'VOLUME') and (engine in cls.COMPAT_ENGINES)
-
-
-class MATERIAL_PT_volume_density(VolumeButtonsPanel, Panel):
- bl_label = "Density"
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- def draw(self, context):
- layout = self.layout
-
- vol = context.material.volume # don't use node material
-
- row = layout.row()
- row.prop(vol, "density")
- row.prop(vol, "density_scale")
-
-
-class MATERIAL_PT_volume_shading(VolumeButtonsPanel, Panel):
- bl_label = "Shading"
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- def draw(self, context):
- layout = self.layout
-
- vol = context.material.volume # don't use node material
-
- split = layout.split()
-
- col = split.column()
- col.prop(vol, "scattering")
- col.prop(vol, "asymmetry")
- col.prop(vol, "transmission_color")
-
- col = split.column()
- sub = col.column(align=True)
- sub.prop(vol, "emission")
- sub.prop(vol, "emission_color", text="")
- sub = col.column(align=True)
- sub.prop(vol, "reflection")
- sub.prop(vol, "reflection_color", text="")
-
-
-class MATERIAL_PT_volume_lighting(VolumeButtonsPanel, Panel):
- bl_label = "Lighting"
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- def draw(self, context):
- layout = self.layout
-
- vol = context.material.volume # don't use node material
-
- split = layout.split()
-
- col = split.column()
- col.prop(vol, "light_method", text="")
-
- col = split.column()
-
- if vol.light_method == 'SHADED':
- col.prop(vol, "use_external_shadows")
- col.prop(vol, "use_light_cache")
- sub = col.column()
- sub.active = vol.use_light_cache
- sub.prop(vol, "cache_resolution")
- elif vol.light_method in {'MULTIPLE_SCATTERING', 'SHADED_PLUS_MULTIPLE_SCATTERING'}:
- sub = col.column()
- sub.enabled = True
- sub.active = False
- sub.label("Light Cache Enabled")
- col.prop(vol, "cache_resolution")
-
- sub = col.column(align=True)
- sub.prop(vol, "ms_diffusion")
- sub.prop(vol, "ms_spread")
- sub.prop(vol, "ms_intensity")
-
-
-class MATERIAL_PT_volume_transp(VolumeButtonsPanel, Panel):
- bl_label = "Transparency"
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- @classmethod
- def poll(cls, context):
- mat = context.material
- engine = context.engine
- return mat and simple_material(mat) and (mat.type == 'VOLUME') and (engine in cls.COMPAT_ENGINES)
-
- def draw(self, context):
- layout = self.layout
-
- mat = context.material # don't use node material
-
- layout.row().prop(mat, "transparency_method", expand=True)
-
-
-class MATERIAL_PT_volume_integration(VolumeButtonsPanel, Panel):
- bl_label = "Integration"
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- def draw(self, context):
- layout = self.layout
-
- vol = context.material.volume # don't use node material
-
- split = layout.split()
-
- col = split.column()
- col.label(text="Step Calculation:")
- col.prop(vol, "step_method", text="")
- col = col.column(align=True)
- col.prop(vol, "step_size")
-
- col = split.column()
- col.label()
- col.prop(vol, "depth_threshold")
-
-
-class MATERIAL_PT_volume_options(VolumeButtonsPanel, Panel):
- bl_label = "Options"
- COMPAT_ENGINES = {'BLENDER_RENDER'}
- bl_options = {'DEFAULT_CLOSED'}
-
- @classmethod
- def poll(cls, context):
- mat = context.material
- engine = context.engine
- return check_material(mat) and (mat.type == 'VOLUME') and (engine in cls.COMPAT_ENGINES)
-
- def draw(self, context):
- layout = self.layout
-
- mat = active_node_mat(context.material)
-
- split = layout.split()
-
- col = split.column()
- if simple_material(context.material):
- col.prop(mat, "use_raytrace")
- col.prop(mat, "use_full_oversampling")
- col.prop(mat, "use_mist")
-
- col = split.column()
- col.label(text="Light Group:")
- col.prop(mat, "light_group", text="")
- row = col.row()
- row.active = bool(mat.light_group)
- row.prop(mat, "use_light_group_exclusive", text="Exclusive")
-
-
class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, Panel):
- COMPAT_ENGINES = {'BLENDER_RENDER'}
+ COMPAT_ENGINES = {'BLENDER_EEVEE'}
_context_path = "material"
_property_type = bpy.types.Material
@@ -1101,29 +216,9 @@ class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
classes = (
- MATERIAL_MT_sss_presets,
MATERIAL_MT_specials,
MATERIAL_UL_matslots,
- MATERIAL_PT_context_material,
MATERIAL_PT_preview,
- MATERIAL_PT_pipeline,
- MATERIAL_PT_diffuse,
- MATERIAL_PT_specular,
- MATERIAL_PT_shading,
- MATERIAL_PT_transp,
- MATERIAL_PT_mirror,
- MATERIAL_PT_sss,
- MATERIAL_PT_halo,
- MATERIAL_PT_flare,
- MATERIAL_PT_strand,
- MATERIAL_PT_options,
- MATERIAL_PT_shadow,
- MATERIAL_PT_volume_density,
- MATERIAL_PT_volume_shading,
- MATERIAL_PT_volume_lighting,
- MATERIAL_PT_volume_transp,
- MATERIAL_PT_volume_integration,
- MATERIAL_PT_volume_options,
MATERIAL_PT_custom_props,
EEVEE_MATERIAL_PT_context_material,
EEVEE_MATERIAL_PT_surface,