[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43195] trunk/blender/release/scripts/ startup/bl_ui/space_node.py: Cycles / Nodes:

Thomas Dinges blender at dingto.org
Fri Jan 6 02:31:43 CET 2012


Revision: 43195
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43195
Author:   dingto
Date:     2012-01-06 01:31:36 +0000 (Fri, 06 Jan 2012)
Log Message:
-----------
Cycles / Nodes:
* Make it possible to add a new material from the Node header, if no material exists in the (active) material slot. 

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 01:14:57 UTC (rev 43194)
+++ trunk/blender/release/scripts/startup/bl_ui/space_node.py	2012-01-06 01:31:36 UTC (rev 43195)
@@ -28,6 +28,7 @@
         layout = self.layout
 
         scene = context.scene
+        ob = context.object
         snode = context.space_data
         snode_id = snode.id
         id_from = snode.id_from
@@ -50,6 +51,8 @@
             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:
+                    layout.template_ID(ob, "active_material", new="material.new")
                 if snode_id:
                     layout.prop(snode_id, "use_nodes")
 



More information about the Bf-blender-cvs mailing list