Cycles / Nodes:

* Make it possible to add a new material from the Node header, if no material exists in the (active) material slot.
This commit is contained in:
2012-01-06 01:31:36 +00:00
parent f983fe709d
commit dd858d6cd9

View File

@@ -28,6 +28,7 @@ class NODE_HT_header(Header):
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 @@ class NODE_HT_header(Header):
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")