From 7503a7edfba9496521baefd70fe6cbcbfce5127b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 12 Oct 2011 15:42:35 +0000 Subject: Cycles: replace surface/volume sockets in output nodes with a single shader socket, decided it's better to render objects as either surface or volume. This may break the volume rendering patch, but shaders with volume closures still get tagged as having volume closures, so it should be fixable without too many changes. --- intern/cycles/blender/addon/ui.py | 54 ++++++-------------------------- intern/cycles/blender/blender_shader.cpp | 6 ++-- 2 files changed, 13 insertions(+), 47 deletions(-) (limited to 'intern/cycles/blender') diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index b8c3753800f..581d7a961bd 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -228,7 +228,7 @@ class CyclesCamera_PT_dof(CyclesButtonsPanel, Panel): sub.prop(ccam, "aperture_rotation", text="Rotation") class Cycles_PT_context_material(CyclesButtonsPanel, Panel): - bl_label = "Surface" + bl_label = "" bl_context = "material" bl_options = {'HIDE_HEADER'} @@ -400,8 +400,8 @@ class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel): elif lamp.type == 'HEMI': layout.label(text="Not supported, interpreted as sun lamp.") -class CyclesLamp_PT_nodes(CyclesButtonsPanel, Panel): - bl_label = "Nodes" +class CyclesLamp_PT_shader(CyclesButtonsPanel, Panel): + bl_label = "Shader" bl_context = "data" @classmethod @@ -412,10 +412,10 @@ class CyclesLamp_PT_nodes(CyclesButtonsPanel, Panel): layout = self.layout mat = context.lamp - panel_node_draw(layout, mat, 'OUTPUT_LAMP', 'Surface') + panel_node_draw(layout, mat, 'OUTPUT_LAMP', 'Shader') -class CyclesWorld_PT_surface(CyclesButtonsPanel, Panel): - bl_label = "Surface" +class CyclesWorld_PT_shader(CyclesButtonsPanel, Panel): + bl_label = "Shader" bl_context = "world" @classmethod @@ -426,39 +426,10 @@ class CyclesWorld_PT_surface(CyclesButtonsPanel, Panel): layout = self.layout mat = context.world - panel_node_draw(layout, mat, 'OUTPUT_WORLD', 'Surface') - -class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel): - bl_label = "Volume" - bl_context = "world" - - @classmethod - def poll(cls, context): - return context.world and CyclesButtonsPanel.poll(context) - - def draw(self, context): - layout = self.layout - layout.active = False - - world = context.world - panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Volume') - -class CyclesMaterial_PT_surface(CyclesButtonsPanel, Panel): - bl_label = "Surface" - bl_context = "material" + panel_node_draw(layout, mat, 'OUTPUT_WORLD', 'Shader') - @classmethod - def poll(cls, context): - return context.material and CyclesButtonsPanel.poll(context) - - def draw(self, context): - layout = self.layout - - mat = context.material - panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Surface') - -class CyclesMaterial_PT_volume(CyclesButtonsPanel, Panel): - bl_label = "Volume" +class CyclesMaterial_PT_shader(CyclesButtonsPanel, Panel): + bl_label = "Shader" bl_context = "material" @classmethod @@ -467,14 +438,9 @@ class CyclesMaterial_PT_volume(CyclesButtonsPanel, Panel): def draw(self, context): layout = self.layout - layout.active = False mat = context.material - cmat = mat.cycles - - panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Volume') - - layout.prop(cmat, "homogeneous_volume") + panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Shader') class CyclesMaterial_PT_displacement(CyclesButtonsPanel, Panel): bl_label = "Displacement" diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index c7eda0a0160..ad7dfb14c64 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -584,7 +584,7 @@ void BlenderSync::sync_materials() closure->input("Color")->value = get_float3(b_mat->diffuse_color()); out = graph->output(); - graph->connect(closure->output("BSDF"), out->input("Surface")); + graph->connect(closure->output("BSDF"), out->input("Closure")); } /* settings */ @@ -625,7 +625,7 @@ void BlenderSync::sync_world() closure->input("Color")->value = get_float3(b_world.horizon_color()); out = graph->output(); - graph->connect(closure->output("Background"), out->input("Surface")); + graph->connect(closure->output("Background"), out->input("Closure")); } shader->set_graph(graph); @@ -675,7 +675,7 @@ void BlenderSync::sync_lamps() closure->input("Strength")->value.x = b_lamp->energy()*10.0f; out = graph->output(); - graph->connect(closure->output("Emission"), out->input("Surface")); + graph->connect(closure->output("Emission"), out->input("Closure")); } shader->set_graph(graph); -- cgit v1.2.3