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
|
2010-01-08 08:54:41 +00:00
|
|
|
from rna_prop_ui import PropertyPanel
|
2009-05-10 12:12:05 +00:00
|
|
|
|
2010-05-16 10:21:00 +00:00
|
|
|
narrowui = bpy.context.user_preferences.view.properties_width_check
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2010-03-22 15:50:16 +00:00
|
|
|
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:
|
|
|
|
mat_node = mat.active_node_material
|
|
|
|
if mat_node:
|
|
|
|
return mat_node
|
|
|
|
else:
|
|
|
|
return mat
|
|
|
|
|
|
|
|
return None
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-11-22 00:22:29 +00:00
|
|
|
class MATERIAL_MT_sss_presets(bpy.types.Menu):
|
|
|
|
bl_label = "SSS Presets"
|
2009-11-22 11:23:19 +00:00
|
|
|
preset_subdir = "sss"
|
* Interaction Presets
This adds a new presets menu in the splash screen and the Input section of
User Preferences to choose a preset interaction style, consisting of key configurations
and also other user preferences such as select mouse button, view rotation style, etc.
Currently, just 'Blender' and 'Maya' presets are included, hopefully we can have more
presets contributed (and maintained!) by the community.
It's best to keep these presets minimal to avoid too many key conflicts. In the Maya one
I changed the view manipulation key/mouse combos and also the transform
manipulator keys, not much more than that.
To save an interaction preset, open the user preferences Input section, and press the
[ + ] button next to the presets menu. It will save out a .py file containing any edited key
maps and navigation preferences to the presets/interaction folder in your scripts folder.
---
Part of this commit changes the way that key maps are exported/displayed in
preferences - now partial key configs are allowed. Previously it would export/import the
entire key configuration, regardless of whether individual key maps were edited or not
(which would make them more susceptible to conflicts in unexpected areas).
(note, in blender terminology, a key map is a category of key items, such as
'Object Mode' or 'View 2d'.)
Now, the export and the UI display work in a similar way to how key maps are
processed internally - Locally edited key maps (after pressing the 'Edit' button) are
processed first, falling back to other key maps in the current key config, and then falling
back to the default key config. So it's possible for a key config to only include a few
key maps, and the rest just gets pulled from the default key config. The preferences
UI display works like this too behind the scenes in deciding what to show users,
however using it is just like it was before, the complexity is hidden.
2010-04-14 06:27:50 +00:00
|
|
|
preset_operator = "script.execute_preset"
|
2009-11-22 11:23:19 +00:00
|
|
|
draw = bpy.types.Menu.draw_preset
|
2009-11-22 00:22:29 +00:00
|
|
|
|
|
|
|
|
2010-01-28 17:31:11 +00:00
|
|
|
class MATERIAL_MT_specials(bpy.types.Menu):
|
2010-02-05 14:29:05 +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')
|
|
|
|
|
|
|
|
|
2009-05-10 12:12:05 +00:00
|
|
|
class MaterialButtonsPanel(bpy.types.Panel):
|
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
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def poll(self, context):
|
|
|
|
mat = context.material
|
2010-02-23 12:48:35 +00:00
|
|
|
engine = context.scene.render.engine
|
2009-10-31 19:31:45 +00:00
|
|
|
return mat and (engine in self.COMPAT_ENGINES)
|
2009-05-28 23:45:50 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-05-28 23:45:50 +00:00
|
|
|
class MATERIAL_PT_preview(MaterialButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Preview"
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
self.layout.template_preview(context.material)
|
2009-05-28 23:45:50 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-07-09 09:42:34 +00:00
|
|
|
class MATERIAL_PT_context_material(MaterialButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = ""
|
|
|
|
bl_show_header = False
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
# An exception, dont call the parent poll func because
|
|
|
|
# this manages materials for all engine types
|
|
|
|
|
2010-02-23 12:48:35 +00:00
|
|
|
engine = context.scene.render.engine
|
2009-10-31 19:31:45 +00:00
|
|
|
return (context.material or context.object) and (engine in self.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
mat = context.material
|
|
|
|
ob = context.object
|
|
|
|
slot = context.material_slot
|
|
|
|
space = context.space_data
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if ob:
|
|
|
|
row = layout.row()
|
|
|
|
|
2010-02-07 12:51:47 +00:00
|
|
|
row.template_list(ob, "material_slots", ob, "active_material_index", rows=2)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = row.column(align=True)
|
2009-12-10 10:23:53 +00:00
|
|
|
col.operator("object.material_slot_add", icon='ZOOMIN', text="")
|
|
|
|
col.operator("object.material_slot_remove", icon='ZOOMOUT', text="")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-28 17:31:11 +00:00
|
|
|
col.menu("MATERIAL_MT_specials", icon='DOWNARROW_HLT', text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if ob.mode == 'EDIT':
|
|
|
|
row = layout.row(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
row.operator("object.material_slot_assign", text="Assign")
|
|
|
|
row.operator("object.material_slot_select", text="Select")
|
|
|
|
row.operator("object.material_slot_deselect", text="Deselect")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
split = layout.split(percentage=0.65)
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-12 12:35:37 +00:00
|
|
|
if ob:
|
|
|
|
split.template_ID(ob, "active_material", new="material.new")
|
|
|
|
row = split.row()
|
|
|
|
if slot:
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(slot, "link", text="")
|
2009-11-12 12:35:37 +00:00
|
|
|
else:
|
2009-11-23 00:27:30 +00:00
|
|
|
row.label()
|
2009-11-12 12:35:37 +00:00
|
|
|
elif mat:
|
|
|
|
split.template_ID(space, "pin_id")
|
2009-11-23 00:27:30 +00:00
|
|
|
split.separator()
|
2009-11-12 12:35:37 +00:00
|
|
|
else:
|
2009-11-14 23:24:15 +00:00
|
|
|
if ob:
|
|
|
|
layout.template_ID(ob, "active_material", new="material.new")
|
|
|
|
elif mat:
|
|
|
|
layout.template_ID(space, "pin_id")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if mat:
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(mat, "type", expand=True)
|
2009-11-12 12:35:37 +00:00
|
|
|
else:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(mat, "type", text="")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2010-01-08 08:54:41 +00:00
|
|
|
class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel):
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
|
|
|
_context_path = "material"
|
|
|
|
|
|
|
|
|
2009-08-15 19:35:03 +00:00
|
|
|
class MATERIAL_PT_shading(MaterialButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Shading"
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2010-02-23 12:48:35 +00:00
|
|
|
engine = context.scene.render.engine
|
2009-10-31 19:31:45 +00:00
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if mat.type in ('SURFACE', 'WIRE'):
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = not mat.shadeless
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(mat, "emit")
|
|
|
|
sub.prop(mat, "ambient")
|
2009-11-12 15:41:44 +00:00
|
|
|
sub = col.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(mat, "translucency")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "shadeless")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = not mat.shadeless
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(mat, "tangent_shading")
|
|
|
|
sub.prop(mat, "cubic")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
elif mat.type == 'HALO':
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(mat, "alpha")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-16 12:54:34 +00:00
|
|
|
class MATERIAL_PT_strand(MaterialButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Strand"
|
|
|
|
bl_default_closed = True
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
mat = context.material
|
2010-02-23 12:48:35 +00:00
|
|
|
engine = context.scene.render.engine
|
2009-10-31 19:31:45 +00:00
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
mat = context.material # dont use node material
|
|
|
|
tan = mat.strand
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
|
|
|
sub = col.column(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.label(text="Size:")
|
|
|
|
sub.prop(tan, "root_size", text="Root")
|
|
|
|
sub.prop(tan, "tip_size", text="Tip")
|
|
|
|
sub.prop(tan, "min_size", text="Minimum")
|
|
|
|
sub.prop(tan, "blender_units")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = (not mat.shadeless)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(tan, "tangent_shading")
|
|
|
|
col.prop(tan, "shape")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Shading:")
|
|
|
|
col.prop(tan, "width_fade")
|
2009-10-31 19:31:45 +00:00
|
|
|
ob = context.object
|
2009-10-31 23:35:56 +00:00
|
|
|
if ob and ob.type == 'MESH':
|
2009-11-23 11:43:38 +00:00
|
|
|
col.prop_object(tan, "uv_layer", ob.data, "uv_textures", text="")
|
2009-10-31 23:35:56 +00:00
|
|
|
else:
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(tan, "uv_layer", text="")
|
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = (not mat.shadeless)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(tan, "surface_diffuse")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = tan.surface_diffuse
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(tan, "blend_distance", text="Distance")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-08-07 19:14:49 +00:00
|
|
|
class MATERIAL_PT_physics(MaterialButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Physics"
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
phys = context.material.physics # dont use node material
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(phys, "distance")
|
|
|
|
col.prop(phys, "friction")
|
|
|
|
col.prop(phys, "align_to_normal")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(phys, "force", slider=True)
|
|
|
|
col.prop(phys, "elasticity", slider=True)
|
|
|
|
col.prop(phys, "damp", slider=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-13 21:22:21 +00:00
|
|
|
class MATERIAL_PT_options(MaterialButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Options"
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2010-02-23 12:48:35 +00:00
|
|
|
engine = context.scene.render.engine
|
2009-10-31 19:31:45 +00:00
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "traceable")
|
|
|
|
col.prop(mat, "full_oversampling")
|
2010-02-07 13:56:36 +00:00
|
|
|
col.prop(mat, "use_sky")
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "exclude_mist")
|
|
|
|
col.prop(mat, "invert_z")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.row()
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(mat, "z_offset")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub.active = mat.transparency and mat.transparency_method == 'Z_TRANSPARENCY'
|
|
|
|
sub = col.column(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.label(text="Light Group:")
|
|
|
|
sub.prop(mat, "light_group", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
row = sub.row()
|
2009-11-22 22:09:06 +00:00
|
|
|
row.active = bool(mat.light_group)
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(mat, "light_group_exclusive", text="Exclusive")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "face_texture")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = mat.face_texture
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(mat, "face_texture_alpha")
|
|
|
|
col.separator()
|
|
|
|
col.prop(mat, "vertex_color_paint")
|
|
|
|
col.prop(mat, "vertex_color_light")
|
|
|
|
col.prop(mat, "object_color")
|
2009-07-17 12:35:57 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-08-15 19:35:03 +00:00
|
|
|
class MATERIAL_PT_shadow(MaterialButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Shadow"
|
|
|
|
bl_default_closed = True
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2010-02-23 12:48:35 +00:00
|
|
|
engine = context.scene.render.engine
|
2009-10-31 19:31:45 +00:00
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "shadows", text="Receive")
|
|
|
|
col.prop(mat, "receive_transparent_shadows", text="Receive Transparent")
|
|
|
|
col.prop(mat, "only_shadow", text="Shadows Only")
|
|
|
|
col.prop(mat, "cast_shadows_only", text="Cast Only")
|
|
|
|
col.prop(mat, "shadow_casting_alpha", text="Casting Alpha")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "cast_buffer_shadows")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = mat.cast_buffer_shadows
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(mat, "shadow_buffer_bias", text="Buffer Bias")
|
|
|
|
col.prop(mat, "ray_shadow_bias", text="Auto Ray Bias")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = (not mat.ray_shadow_bias)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(mat, "shadow_ray_bias", text="Ray Bias")
|
2010-02-11 15:43:31 +00:00
|
|
|
col.prop(mat, "cast_approximate")
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2009-06-14 18:16:38 +00:00
|
|
|
class MATERIAL_PT_diffuse(MaterialButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Diffuse"
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2010-02-23 12:48:35 +00:00
|
|
|
engine = context.scene.render.engine
|
2009-10-31 19:31:45 +00:00
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "diffuse_color", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = (not mat.shadeless)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(mat, "diffuse_intensity", text="Intensity")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
col.active = (not mat.shadeless)
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "diffuse_shader", text="")
|
|
|
|
col.prop(mat, "use_diffuse_ramp", text="Ramp")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.active = (not mat.shadeless)
|
|
|
|
if mat.diffuse_shader == 'OREN_NAYAR':
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "roughness")
|
2009-10-31 19:31:45 +00:00
|
|
|
elif mat.diffuse_shader == 'MINNAERT':
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "darkness")
|
2009-10-31 19:31:45 +00:00
|
|
|
elif mat.diffuse_shader == 'TOON':
|
2009-11-12 12:35:37 +00:00
|
|
|
split = col.split()
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "diffuse_toon_size", text="Size")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "diffuse_toon_smooth", text="Smooth")
|
2009-10-31 19:31:45 +00:00
|
|
|
elif mat.diffuse_shader == 'FRESNEL':
|
2009-11-12 12:35:37 +00:00
|
|
|
split = col.split()
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "diffuse_fresnel", text="Fresnel")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "diffuse_fresnel_factor", text="Factor")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if mat.use_diffuse_ramp:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.template_color_ramp(mat, "diffuse_ramp", expand=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-12 12:35:37 +00:00
|
|
|
split = layout.split()
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "diffuse_ramp_input", text="Input")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "diffuse_ramp_blend", text="Blend")
|
2009-10-31 19:31:45 +00:00
|
|
|
row = layout.row()
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(mat, "diffuse_ramp_factor", text="Factor")
|
2009-08-25 14:26:27 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-14 18:16:38 +00:00
|
|
|
class MATERIAL_PT_specular(MaterialButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Specular"
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2010-02-23 12:48:35 +00:00
|
|
|
engine = context.scene.render.engine
|
2009-10-31 19:31:45 +00:00
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
layout.active = (not mat.shadeless)
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "specular_color", text="")
|
|
|
|
col.prop(mat, "specular_intensity", text="Intensity")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "specular_shader", text="")
|
|
|
|
col.prop(mat, "use_specular_ramp", text="Ramp")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
if mat.specular_shader in ('COOKTORR', 'PHONG'):
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "specular_hardness", text="Hardness")
|
2009-10-31 19:31:45 +00:00
|
|
|
elif mat.specular_shader == 'BLINN':
|
2009-11-12 12:35:37 +00:00
|
|
|
split = layout.split()
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "specular_hardness", text="Hardness")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "specular_ior", text="IOR")
|
2009-10-31 19:31:45 +00:00
|
|
|
elif mat.specular_shader == 'WARDISO':
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "specular_slope", text="Slope")
|
2009-10-31 19:31:45 +00:00
|
|
|
elif mat.specular_shader == 'TOON':
|
2009-11-12 12:35:37 +00:00
|
|
|
split = layout.split()
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "specular_toon_size", text="Size")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "specular_toon_smooth", text="Smooth")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if mat.use_specular_ramp:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.template_color_ramp(mat, "specular_ramp", expand=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-11-12 12:35:37 +00:00
|
|
|
split = layout.split()
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "specular_ramp_input", text="Input")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "specular_ramp_blend", text="Blend")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
row = layout.row()
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(mat, "specular_ramp_factor", text="Factor")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-05-10 12:12:05 +00:00
|
|
|
class MATERIAL_PT_sss(MaterialButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Subsurface Scattering"
|
|
|
|
bl_default_closed = True
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2010-02-23 12:48:35 +00:00
|
|
|
engine = context.scene.render.engine
|
2009-10-31 19:31:45 +00:00
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-10-31 19:31:45 +00:00
|
|
|
sss = mat.subsurface_scattering
|
|
|
|
|
|
|
|
self.layout.active = (not mat.shadeless)
|
2009-11-23 00:27:30 +00:00
|
|
|
self.layout.prop(sss, "enabled", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-10-31 19:31:45 +00:00
|
|
|
sss = mat.subsurface_scattering
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-11-28 23:37:56 +00:00
|
|
|
|
2009-11-22 10:06:08 +00:00
|
|
|
layout.active = (sss.enabled) and (not mat.shadeless)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-22 00:03:42 +00:00
|
|
|
row = layout.row().split()
|
|
|
|
sub = row.row(align=True).split(percentage=0.75)
|
* Interaction Presets
This adds a new presets menu in the splash screen and the Input section of
User Preferences to choose a preset interaction style, consisting of key configurations
and also other user preferences such as select mouse button, view rotation style, etc.
Currently, just 'Blender' and 'Maya' presets are included, hopefully we can have more
presets contributed (and maintained!) by the community.
It's best to keep these presets minimal to avoid too many key conflicts. In the Maya one
I changed the view manipulation key/mouse combos and also the transform
manipulator keys, not much more than that.
To save an interaction preset, open the user preferences Input section, and press the
[ + ] button next to the presets menu. It will save out a .py file containing any edited key
maps and navigation preferences to the presets/interaction folder in your scripts folder.
---
Part of this commit changes the way that key maps are exported/displayed in
preferences - now partial key configs are allowed. Previously it would export/import the
entire key configuration, regardless of whether individual key maps were edited or not
(which would make them more susceptible to conflicts in unexpected areas).
(note, in blender terminology, a key map is a category of key items, such as
'Object Mode' or 'View 2d'.)
Now, the export and the UI display work in a similar way to how key maps are
processed internally - Locally edited key maps (after pressing the 'Edit' button) are
processed first, falling back to other key maps in the current key config, and then falling
back to the default key config. So it's possible for a key config to only include a few
key maps, and the rest just gets pulled from the default key config. The preferences
UI display works like this too behind the scenes in deciding what to show users,
however using it is just like it was before, the complexity is hidden.
2010-04-14 06:27:50 +00:00
|
|
|
sub.menu("MATERIAL_MT_sss_presets", text=bpy.types.MATERIAL_MT_sss_presets.bl_label)
|
|
|
|
sub.operator("material.sss_preset_add", text="", icon="ZOOMIN")
|
2009-11-22 00:22:29 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(sss, "ior")
|
|
|
|
col.prop(sss, "scale")
|
|
|
|
col.prop(sss, "color", text="")
|
Changes to Color Management
After testing and feedback, I've decided to slightly modify the way color
management works internally. While the previous method worked well for
rendering, was a smaller transition and had some advantages over this
new method, it was a bit more ambiguous, and was making things difficult
for other areas such as compositing.
This implementation now considers all color data (with only a couple of
exceptions such as brush colors) to be stored in linear RGB color space,
rather than sRGB as previously. This brings it in line with Nuke, which also
operates this way, quite successfully. Color swatches, pickers, color ramp
display are now gamma corrected to display gamma so you can see what
you're doing, but the numbers themselves are considered linear. This
makes understanding blending modes more clear (a 0.5 value on overlay
will not change the result now) as well as making color swatches act more
predictably in the compositor, however bringing over color values from
applications like photoshop or gimp, that operate in a gamma space,
will give identical results.
This commit will convert over existing files saved by earlier 2.5 versions to
work generally the same, though there may be some slight differences with
things like textures. Now that we're set on changing other areas of shading,
this won't be too disruptive overall.
I've made a diagram explaining the pipeline here:
http://mke3.net/blender/devel/2.5/25_linear_workflow_pipeline.png
and some docs here:
http://www.blender.org/development/release-logs/blender-250/color-management/
2009-12-02 07:56:34 +00:00
|
|
|
col.prop(sss, "radius", text="RGB Radius", expand=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
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_tolerance", text="Error")
|
2009-06-14 18:16:38 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-08-15 19:35:03 +00:00
|
|
|
class MATERIAL_PT_mirror(MaterialButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Mirror"
|
|
|
|
bl_default_closed = True
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2010-02-23 12:48:35 +00:00
|
|
|
engine = context.scene.render.engine
|
2009-10-31 19:31:45 +00:00
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
2010-03-22 15:50:16 +00:00
|
|
|
raym = active_node_mat(context.material).raytrace_mirror
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
self.layout.prop(raym, "enabled", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-10-31 19:31:45 +00:00
|
|
|
raym = mat.raytrace_mirror
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
layout.active = raym.enabled
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(raym, "reflect_factor")
|
|
|
|
col.prop(mat, "mirror_color", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(raym, "fresnel")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = raym.fresnel > 0
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(raym, "fresnel_factor", text="Blend")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.separator()
|
|
|
|
col.prop(raym, "depth")
|
2010-05-02 04:40:44 +00:00
|
|
|
col.prop(raym, "distance", text="Max Dist")
|
2009-11-23 00:27:30 +00:00
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.split(percentage=0.4)
|
2010-05-02 04:40:44 +00:00
|
|
|
sub.active = raym.distance > 0.0
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.label(text="Fade To:")
|
|
|
|
sub.prop(raym, "fade_to", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Gloss:")
|
|
|
|
col.prop(raym, "gloss_factor", text="Amount")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = raym.gloss_factor < 1.0
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(raym, "gloss_threshold", text="Threshold")
|
|
|
|
sub.prop(raym, "gloss_samples", text="Samples")
|
|
|
|
sub.prop(raym, "gloss_anisotropic", text="Anisotropic")
|
2009-08-25 14:26:27 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-08-15 19:35:03 +00:00
|
|
|
class MATERIAL_PT_transp(MaterialButtonsPanel):
|
2009-10-31 23:35:56 +00:00
|
|
|
bl_label = "Transparency"
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_default_closed = True
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2010-02-23 12:48:35 +00:00
|
|
|
engine = context.scene.render.engine
|
2009-10-31 19:31:45 +00:00
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
self.layout.prop(mat, "transparency", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-10-31 19:31:45 +00:00
|
|
|
rayt = mat.raytrace_transparency
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.active = mat.transparency and (not mat.shadeless)
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(mat, "transparency_method", expand=True)
|
2009-11-12 12:35:37 +00:00
|
|
|
else:
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(mat, "transparency_method", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "alpha")
|
2009-10-31 19:31:45 +00:00
|
|
|
row = col.row()
|
|
|
|
row.active = mat.transparency and (not mat.shadeless)
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(mat, "specular_alpha", text="Specular")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
col.active = (not mat.shadeless)
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(rayt, "fresnel")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = rayt.fresnel > 0
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(rayt, "fresnel_factor", text="Blend")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if mat.transparency_method == 'RAYTRACE':
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
split = layout.split()
|
|
|
|
split.active = mat.transparency
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(rayt, "ior")
|
|
|
|
col.prop(rayt, "filter")
|
|
|
|
col.prop(rayt, "falloff")
|
|
|
|
col.prop(rayt, "limit")
|
|
|
|
col.prop(rayt, "depth")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Gloss:")
|
|
|
|
col.prop(rayt, "gloss_factor", text="Amount")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = rayt.gloss_factor < 1.0
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(rayt, "gloss_threshold", text="Threshold")
|
|
|
|
sub.prop(rayt, "gloss_samples", text="Samples")
|
2009-08-13 05:21:25 +00:00
|
|
|
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-12 02:32:21 +00:00
|
|
|
class MATERIAL_PT_transp_game(MaterialButtonsPanel):
|
|
|
|
bl_label = "Transparency"
|
|
|
|
bl_default_closed = True
|
|
|
|
COMPAT_ENGINES = {'BLENDER_GAME'}
|
|
|
|
|
|
|
|
def poll(self, context):
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2010-02-23 12:48:35 +00:00
|
|
|
engine = context.scene.render.engine
|
2010-01-12 02:32:21 +00:00
|
|
|
return mat and (engine in self.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2010-01-12 02:32:21 +00:00
|
|
|
|
|
|
|
self.layout.prop(mat, "transparency", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2010-03-22 15:50:16 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2010-01-12 02:32:21 +00:00
|
|
|
rayt = mat.raytrace_transparency
|
|
|
|
wide_ui = context.region.width > narrowui
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.active = mat.transparency and (not mat.shadeless)
|
|
|
|
if wide_ui:
|
|
|
|
row.prop(mat, "transparency_method", expand=True)
|
|
|
|
else:
|
|
|
|
row.prop(mat, "transparency_method", text="")
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.prop(mat, "alpha")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
class MATERIAL_PT_halo(MaterialButtonsPanel):
|
2009-10-31 23:35:56 +00:00
|
|
|
bl_label = "Halo"
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
mat = context.material
|
2010-02-23 12:48:35 +00:00
|
|
|
engine = context.scene.render.engine
|
2009-10-31 19:31:45 +00:00
|
|
|
return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
mat = context.material # dont use node material
|
|
|
|
halo = mat.halo
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(mat, "diffuse_color", text="")
|
|
|
|
col.prop(halo, "size")
|
|
|
|
col.prop(halo, "hardness")
|
|
|
|
col.prop(halo, "add")
|
|
|
|
col.label(text="Options:")
|
|
|
|
col.prop(halo, "texture")
|
|
|
|
col.prop(halo, "vertex_normal")
|
|
|
|
col.prop(halo, "xalpha")
|
|
|
|
col.prop(halo, "shaded")
|
|
|
|
col.prop(halo, "soft")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(halo, "ring")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = halo.ring
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(halo, "rings")
|
|
|
|
sub.prop(mat, "mirror_color", text="")
|
|
|
|
col.separator()
|
|
|
|
col.prop(halo, "lines")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = halo.lines
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(halo, "line_number", text="Lines")
|
|
|
|
sub.prop(mat, "specular_color", text="")
|
|
|
|
col.separator()
|
|
|
|
col.prop(halo, "star")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = halo.star
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(halo, "star_tips")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
class MATERIAL_PT_flare(MaterialButtonsPanel):
|
2009-10-31 23:35:56 +00:00
|
|
|
bl_label = "Flare"
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
mat = context.material
|
2010-02-23 12:48:35 +00:00
|
|
|
engine = context.scene.render.engine
|
2009-10-31 19:31:45 +00:00
|
|
|
return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
halo = context.material.halo
|
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
self.layout.prop(halo, "flare_mode", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
mat = context.material # dont use node material
|
|
|
|
halo = mat.halo
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
layout.active = halo.flare_mode
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(halo, "flare_size", text="Size")
|
|
|
|
col.prop(halo, "flare_boost", text="Boost")
|
|
|
|
col.prop(halo, "flare_seed", text="Seed")
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(halo, "flares_sub", text="Subflares")
|
|
|
|
col.prop(halo, "flare_subsize", text="Subsize")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
class VolumeButtonsPanel(bpy.types.Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_context = "material"
|
2009-09-01 00:33:39 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def poll(self, context):
|
|
|
|
mat = context.material
|
2010-02-23 12:48:35 +00:00
|
|
|
engine = context.scene.render.engine
|
2009-10-31 19:31:45 +00:00
|
|
|
return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
class MATERIAL_PT_volume_density(VolumeButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Density"
|
|
|
|
bl_default_closed = False
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
vol = context.material.volume # dont use node material
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(vol, "density")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(vol, "density_scale")
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Shading"
|
|
|
|
bl_default_closed = False
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
vol = context.material.volume # dont use node material
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(vol, "scattering")
|
|
|
|
col.prop(vol, "asymmetry")
|
|
|
|
col.prop(vol, "transmission_color")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(vol, "emission")
|
|
|
|
sub.prop(vol, "emission_color", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(vol, "reflection")
|
|
|
|
sub.prop(vol, "reflection_color", text="")
|
2009-08-16 06:10:31 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Lighting"
|
|
|
|
bl_default_closed = False
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
vol = context.material.volume # dont use node material
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(vol, "lighting_mode", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if vol.lighting_mode == 'SHADED':
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(vol, "external_shadows")
|
|
|
|
col.prop(vol, "light_cache")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = vol.light_cache
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(vol, "cache_resolution")
|
2009-10-31 19:31:45 +00:00
|
|
|
elif vol.lighting_mode in ('MULTIPLE_SCATTERING', 'SHADED_PLUS_MULTIPLE_SCATTERING'):
|
|
|
|
sub = col.column()
|
|
|
|
sub.enabled = True
|
|
|
|
sub.active = False
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(vol, "light_cache")
|
|
|
|
col.prop(vol, "cache_resolution")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
sub = col.column(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(vol, "ms_diffusion")
|
|
|
|
sub.prop(vol, "ms_spread")
|
|
|
|
sub.prop(vol, "ms_intensity")
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
|
2009-10-31 23:35:56 +00:00
|
|
|
bl_label = "Transparency"
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
mat = context.material # dont use node material
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(mat, "transparency_method", expand=True)
|
2009-11-12 12:35:37 +00:00
|
|
|
else:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(mat, "transparency_method", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Integration"
|
|
|
|
bl_default_closed = False
|
2009-12-13 16:20:18 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
vol = context.material.volume # dont use node material
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Step Calculation:")
|
|
|
|
col.prop(vol, "step_calculation", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
col = col.column(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(vol, "step_size")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-12 12:35:37 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label()
|
|
|
|
col.prop(vol, "depth_cutoff")
|
2010-04-17 19:05:53 +00:00
|
|
|
|
|
|
|
|
2010-04-16 04:24:29 +00:00
|
|
|
class MATERIAL_PT_volume_options(VolumeButtonsPanel):
|
|
|
|
bl_label = "Options"
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
|
|
|
bl_default_closed = True
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
mat = active_node_mat(context.material)
|
|
|
|
wide_ui = context.region.width > narrowui
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.prop(mat, "traceable")
|
|
|
|
col.prop(mat, "full_oversampling")
|
|
|
|
col.prop(mat, "exclude_mist")
|
2010-04-17 19:05:53 +00:00
|
|
|
|
2010-04-16 04:24:29 +00:00
|
|
|
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, "light_group_exclusive", text="Exclusive")
|
|
|
|
|
2009-11-22 00:22:29 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
classes = [
|
|
|
|
MATERIAL_PT_context_material,
|
|
|
|
MATERIAL_PT_preview,
|
|
|
|
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_physics,
|
|
|
|
MATERIAL_PT_strand,
|
|
|
|
MATERIAL_PT_options,
|
|
|
|
MATERIAL_PT_shadow,
|
|
|
|
MATERIAL_PT_transp_game,
|
|
|
|
|
|
|
|
MATERIAL_MT_sss_presets,
|
|
|
|
MATERIAL_MT_specials,
|
|
|
|
|
|
|
|
MATERIAL_PT_volume_density,
|
|
|
|
MATERIAL_PT_volume_shading,
|
|
|
|
MATERIAL_PT_volume_lighting,
|
|
|
|
MATERIAL_PT_volume_transp,
|
|
|
|
MATERIAL_PT_volume_integration,
|
2010-04-16 04:24:29 +00:00
|
|
|
MATERIAL_PT_volume_options,
|
2010-02-14 11:21:21 +00:00
|
|
|
|
|
|
|
MATERIAL_PT_custom_props]
|
|
|
|
|
|
|
|
|
|
|
|
def register():
|
|
|
|
register = bpy.types.register
|
|
|
|
for cls in classes:
|
|
|
|
register(cls)
|
|
|
|
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
def unregister():
|
|
|
|
unregister = bpy.types.unregister
|
|
|
|
for cls in classes:
|
|
|
|
unregister(cls)
|
2010-02-16 09:55:07 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
register()
|