Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2012-01-06 20:37:07 +0400
committerThomas Dinges <blender@dingto.org>2012-01-06 20:37:07 +0400
commit7ff5a17ff2959fcd1a13b245596c52e057e57e39 (patch)
tree4382c1e635a029dfa02f680410495b22b7fda95a /release
parent667ae778b97216297331508c7213d103d7725d04 (diff)
Tweaks for Node Header UI code:
* Don't show "New material" operator, when object type can't have materials * Don't show "Use Nodes" for lamps in Blender Internal.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_node.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index 4bd0b22779e..9f714f80b34 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -49,11 +49,14 @@ class NODE_HT_header(Header):
layout.prop(snode, "shader_type", text="", expand=True)
if not scene.render.use_shading_nodes or snode.shader_type == 'OBJECT':
- if id_from:
- layout.template_ID(id_from, "active_material", new="material.new")
- else:
+ # Show material.new when no active ID/slot exists
+ if not id_from and ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'METABALL'}:
layout.template_ID(ob, "active_material", new="material.new")
- if snode_id:
+ # Material ID, but not for Lamps
+ if id_from and ob.type != 'LAMP':
+ layout.template_ID(id_from, "active_material", new="material.new")
+ # Don't show "Use Nodes" Button when Engine is BI for Lamps
+ if snode_id and not (scene.render.use_shading_nodes == 0 and ob.type == 'LAMP'):
layout.prop(snode_id, "use_nodes")
elif snode.tree_type == 'TEXTURE':