2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-05-10 12:12:05 +00:00
|
|
|
import bpy
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
from bpy.types import Menu, Panel, UIList
|
2010-01-08 08:54:41 +00:00
|
|
|
from rna_prop_ui import PropertyPanel
|
2013-02-10 10:29:38 +00:00
|
|
|
from bpy.app.translations import pgettext_iface as iface_
|
2017-05-30 15:16:36 +00:00
|
|
|
from bpy_extras.node_utils import find_node_input, find_output_node
|
2011-09-20 18:29:19 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class MATERIAL_MT_specials(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Material Specials"
|
2010-01-28 17:31:11 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.operator("object.material_slot_copy", icon='COPY_ID')
|
|
|
|
layout.operator("material.copy", icon='COPYDOWN')
|
|
|
|
layout.operator("material.paste", icon='PASTEDOWN')
|
|
|
|
|
|
|
|
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
class MATERIAL_UL_matslots(UIList):
|
2017-03-19 22:43:18 +00:00
|
|
|
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
|
2012-12-28 10:45:59 +00:00
|
|
|
# assert(isinstance(item, bpy.types.MaterialSlot)
|
2014-04-24 19:31:20 +00:00
|
|
|
# ob = data
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
slot = item
|
|
|
|
ma = slot.material
|
|
|
|
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
2013-11-23 19:37:23 +00:00
|
|
|
if ma:
|
|
|
|
layout.prop(ma, "name", text="", emboss=False, icon_value=icon)
|
|
|
|
else:
|
|
|
|
layout.label(text="", icon_value=icon)
|
2015-04-14 00:29:11 +00:00
|
|
|
elif self.layout_type == 'GRID':
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
layout.alignment = 'CENTER'
|
2013-02-08 16:01:21 +00:00
|
|
|
layout.label(text="", icon_value=icon)
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
|
|
|
|
|
2015-01-29 04:35:06 +00:00
|
|
|
class MaterialButtonsPanel:
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_context = "material"
|
|
|
|
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
|
2009-05-20 13:34:04 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2017-10-16 19:15:03 +00:00
|
|
|
return context.material and (context.engine in cls.COMPAT_ENGINES)
|
2010-08-09 01:37:09 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class MATERIAL_PT_preview(MaterialButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Preview"
|
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.
2018-04-19 15:34:44 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
2010-08-12 19:36:10 +00:00
|
|
|
self.layout.template_preview(context.material)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, Panel):
|
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.
2018-04-19 15:34:44 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
2010-08-12 19:36:10 +00:00
|
|
|
_context_path = "material"
|
2010-12-17 10:33:28 +00:00
|
|
|
_property_type = bpy.types.Material
|
2011-04-04 10:13:04 +00:00
|
|
|
|
2017-03-18 09:03:24 +00:00
|
|
|
|
2017-04-25 16:46:59 +00:00
|
|
|
class EEVEE_MATERIAL_PT_context_material(MaterialButtonsPanel, Panel):
|
|
|
|
bl_label = ""
|
|
|
|
bl_context = "material"
|
|
|
|
bl_options = {'HIDE_HEADER'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2017-10-16 19:15:03 +00:00
|
|
|
engine = context.engine
|
2017-04-25 16:46:59 +00:00
|
|
|
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'
|
|
|
|
|
2018-04-05 16:20:27 +00:00
|
|
|
if ob.mode == 'EDIT':
|
2017-04-25 16:46:59 +00:00
|
|
|
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 slot:
|
|
|
|
row.prop(slot, "link", text="")
|
|
|
|
else:
|
|
|
|
row.label()
|
|
|
|
elif mat:
|
|
|
|
split.template_ID(space, "pin_id")
|
|
|
|
split.separator()
|
|
|
|
|
|
|
|
|
2017-05-30 15:16:36 +00:00
|
|
|
def panel_node_draw(layout, ntree, output_type):
|
|
|
|
node = find_output_node(ntree, output_type)
|
|
|
|
|
|
|
|
if node:
|
2017-06-23 08:49:09 +00:00
|
|
|
input = find_node_input(node, 'Surface')
|
2017-08-01 16:03:16 +00:00
|
|
|
if input:
|
|
|
|
layout.template_node_view(ntree, node, input)
|
|
|
|
else:
|
|
|
|
layout.label(text="Incompatible output node")
|
|
|
|
else:
|
|
|
|
layout.label(text="No output node")
|
2017-05-30 15:16:36 +00:00
|
|
|
|
|
|
|
|
2017-04-25 16:46:59 +00:00
|
|
|
class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel):
|
|
|
|
bl_label = "Surface"
|
|
|
|
bl_context = "material"
|
|
|
|
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2017-10-16 19:15:03 +00:00
|
|
|
engine = context.engine
|
2017-04-25 16:46:59 +00:00
|
|
|
return context.material and (engine in cls.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
mat = context.material
|
2017-04-25 21:48:26 +00:00
|
|
|
|
2017-05-18 15:42:25 +00:00
|
|
|
layout.prop(mat, "use_nodes", icon='NODETREE')
|
2017-05-17 13:03:01 +00:00
|
|
|
layout.separator()
|
|
|
|
|
2017-05-30 15:16:36 +00:00
|
|
|
if mat.use_nodes:
|
2017-08-01 21:53:58 +00:00
|
|
|
panel_node_draw(layout, mat.node_tree, ('OUTPUT_EEVEE_MATERIAL', 'OUTPUT_MATERIAL'))
|
2017-05-30 15:16:36 +00:00
|
|
|
else:
|
2017-05-17 15:41:21 +00:00
|
|
|
raym = mat.raytrace_mirror
|
2017-05-30 15:16:36 +00:00
|
|
|
layout.prop(mat, "diffuse_color", text="Base Color")
|
2017-05-17 15:41:21 +00:00
|
|
|
layout.prop(raym, "reflect_factor", text="Metallic")
|
|
|
|
layout.prop(mat, "specular_intensity", text="Specular")
|
|
|
|
layout.prop(raym, "gloss_factor", text="Roughness")
|
2017-04-25 16:46:59 +00:00
|
|
|
|
|
|
|
|
2017-07-09 10:01:29 +00:00
|
|
|
class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
|
|
|
|
bl_label = "Options"
|
|
|
|
bl_context = "material"
|
|
|
|
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2017-10-16 19:15:03 +00:00
|
|
|
engine = context.engine
|
2017-07-09 10:01:29 +00:00
|
|
|
return context.material and (engine in cls.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
mat = context.material
|
|
|
|
|
|
|
|
layout.prop(mat, "blend_method")
|
|
|
|
|
2017-07-11 10:39:20 +00:00
|
|
|
if mat.blend_method != "OPAQUE":
|
|
|
|
layout.prop(mat, "transparent_shadow_method")
|
2017-07-10 16:34:33 +00:00
|
|
|
|
2017-07-11 10:39:20 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.active = ((mat.blend_method == "CLIP") or (mat.transparent_shadow_method == "CLIP"))
|
2017-11-22 03:51:21 +00:00
|
|
|
row.prop(mat, "alpha_threshold")
|
2017-07-09 10:01:29 +00:00
|
|
|
|
2017-07-11 10:39:20 +00:00
|
|
|
if mat.blend_method not in {"OPAQUE", "CLIP", "HASHED"}:
|
|
|
|
layout.prop(mat, "transparent_hide_backside")
|
2017-08-09 21:48:42 +00:00
|
|
|
|
2017-08-10 13:43:15 +00:00
|
|
|
layout.prop(mat, "use_screen_refraction")
|
|
|
|
layout.prop(mat, "refraction_depth")
|
2017-07-11 10:39:20 +00:00
|
|
|
|
2017-11-13 23:49:54 +00:00
|
|
|
layout.prop(mat, "use_screen_subsurface")
|
2017-11-22 03:51:21 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.active = mat.use_screen_subsurface
|
|
|
|
row.prop(mat, "use_sss_translucency")
|
2017-11-13 23:49:54 +00:00
|
|
|
|
2017-07-11 10:39:20 +00:00
|
|
|
|
2017-03-18 09:03:24 +00:00
|
|
|
classes = (
|
2017-03-19 15:34:32 +00:00
|
|
|
MATERIAL_MT_specials,
|
|
|
|
MATERIAL_UL_matslots,
|
|
|
|
MATERIAL_PT_preview,
|
|
|
|
MATERIAL_PT_custom_props,
|
2017-04-25 16:46:59 +00:00
|
|
|
EEVEE_MATERIAL_PT_context_material,
|
|
|
|
EEVEE_MATERIAL_PT_surface,
|
2017-07-09 10:01:29 +00:00
|
|
|
EEVEE_MATERIAL_PT_options,
|
2017-03-18 09:03:24 +00:00
|
|
|
)
|
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
2017-03-18 09:03:24 +00:00
|
|
|
from bpy.utils import register_class
|
|
|
|
for cls in classes:
|
|
|
|
register_class(cls)
|