[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43201] trunk/blender/release/scripts/ startup/bl_ui/space_node.py: Tweaks for Node Header UI code:

Thomas Dinges blender at dingto.org
Fri Jan 6 17:37:11 CET 2012


Revision: 43201
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43201
Author:   dingto
Date:     2012-01-06 16:37:07 +0000 (Fri, 06 Jan 2012)
Log Message:
-----------
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. 

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_node.py

Modified: trunk/blender/release/scripts/startup/bl_ui/space_node.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_node.py	2012-01-06 10:08:46 UTC (rev 43200)
+++ trunk/blender/release/scripts/startup/bl_ui/space_node.py	2012-01-06 16:37:07 UTC (rev 43201)
@@ -49,11 +49,14 @@
                 layout.prop(snode, "shader_type", text="", expand=True)
 
             if not scene.render.use_shading_nodes or snode.shader_type == 'OBJECT':
-                if id_from:
+                # 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")
+                # Material ID, but not for Lamps
+                if id_from and ob.type != 'LAMP':
                     layout.template_ID(id_from, "active_material", new="material.new")
-                else:
-                    layout.template_ID(ob, "active_material", new="material.new")
-                if snode_id:
+                # 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':



More information about the Bf-blender-cvs mailing list