[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41733] trunk/blender/intern/cycles/ blender/addon/ui.py: Cycles: when material/world/lamp doesn't use nodes, show color in the UI.
Brecht Van Lommel
brechtvanlommel at pandora.be
Thu Nov 10 14:00:53 CET 2011
Revision: 41733
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41733
Author: blendix
Date: 2011-11-10 13:00:53 +0000 (Thu, 10 Nov 2011)
Log Message:
-----------
Cycles: when material/world/lamp doesn't use nodes, show color in the UI.
Modified Paths:
--------------
trunk/blender/intern/cycles/blender/addon/ui.py
Modified: trunk/blender/intern/cycles/blender/addon/ui.py
===================================================================
--- trunk/blender/intern/cycles/blender/addon/ui.py 2011-11-10 13:00:27 UTC (rev 41732)
+++ trunk/blender/intern/cycles/blender/addon/ui.py 2011-11-10 13:00:53 UTC (rev 41733)
@@ -350,7 +350,7 @@
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 @@
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 @@
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 @@
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 @@
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"
More information about the Bf-blender-cvs
mailing list