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:
@@ -28,6 +28,7 @@ class NODE_HT_header(Header):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
|
ob = context.object
|
||||||
snode = context.space_data
|
snode = context.space_data
|
||||||
snode_id = snode.id
|
snode_id = snode.id
|
||||||
id_from = snode.id_from
|
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 not scene.render.use_shading_nodes or snode.shader_type == 'OBJECT':
|
||||||
if id_from:
|
if id_from:
|
||||||
layout.template_ID(id_from, "active_material", new="material.new")
|
layout.template_ID(id_from, "active_material", new="material.new")
|
||||||
|
else:
|
||||||
|
layout.template_ID(ob, "active_material", new="material.new")
|
||||||
if snode_id:
|
if snode_id:
|
||||||
layout.prop(snode_id, "use_nodes")
|
layout.prop(snode_id, "use_nodes")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user