diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-10 17:00:53 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-10 17:00:53 +0400 |
commit | 2adcac7661ea475d6f309698fe93068d070bf460 (patch) | |
tree | b1c099c19c8dd67eabb924d92be685b339b5c47b /intern | |
parent | 7bcd1a6c47c69b6b7f84e71e24277f68c9e3f629 (diff) |
Cycles: when material/world/lamp doesn't use nodes, show color in the UI.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index dfbfb769170..01b358869ec 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -350,7 +350,7 @@ def find_node_input(node, name): def panel_node_draw(layout, id, output_type, input_name): if not id.node_tree: layout.prop(id, "use_nodes", icon='NODETREE') - return + return False ntree = id.node_tree @@ -360,6 +360,8 @@ def panel_node_draw(layout, id, output_type, input_name): else: input = find_node_input(node, input_name) layout.template_node_view(ntree, node, input); + + return True class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel): bl_label = "Lamp" @@ -411,8 +413,9 @@ class CyclesLamp_PT_nodes(CyclesButtonsPanel, Panel): def draw(self, context): layout = self.layout - mat = context.lamp - panel_node_draw(layout, mat, 'OUTPUT_LAMP', 'Surface') + lamp = context.lamp + if not panel_node_draw(layout, lamp, 'OUTPUT_LAMP', 'Surface'): + layout.prop(lamp, "color") class CyclesWorld_PT_surface(CyclesButtonsPanel, Panel): bl_label = "Surface" @@ -425,8 +428,9 @@ class CyclesWorld_PT_surface(CyclesButtonsPanel, Panel): def draw(self, context): layout = self.layout - mat = context.world - panel_node_draw(layout, mat, 'OUTPUT_WORLD', 'Surface') + world = context.world + if not panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Surface'): + layout.prop(world, "horizon_color", text="Color") class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel): bl_label = "Volume" @@ -457,7 +461,8 @@ class CyclesMaterial_PT_surface(CyclesButtonsPanel, Panel): layout = self.layout mat = context.material - panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Surface') + if not panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Surface'): + layout.prop(mat, "diffuse_color") class CyclesMaterial_PT_volume(CyclesButtonsPanel, Panel): bl_label = "Volume" |