RenderEngine/Nodes: system to check for shading nodes compatibility

* Scene.use_shading_nodes property to check if RenderEngine is using new shading
  nodes system, and RenderEngine.bl_use_shading_nodes to set this.
* Add mechanism for tagging nodes as being compatible with the old/new system.
This commit is contained in:
2011-11-02 19:24:30 +00:00
parent 30f1f28a8a
commit ac52c79cb1
31 changed files with 121 additions and 21 deletions

View File

@@ -27,6 +27,7 @@ class NODE_HT_header(Header):
def draw(self, context):
layout = self.layout
scene = context.scene
snode = context.space_data
snode_id = snode.id
id_from = snode.id_from
@@ -43,10 +44,14 @@ class NODE_HT_header(Header):
layout.prop(snode, "tree_type", text="", expand=True)
if snode.tree_type == 'SHADER':
if id_from:
layout.template_ID(id_from, "active_material", new="material.new")
if snode_id:
layout.prop(snode_id, "use_nodes")
if scene.render.use_shading_nodes:
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")
if snode_id:
layout.prop(snode_id, "use_nodes")
elif snode.tree_type == 'TEXTURE':
layout.prop(snode, "texture_type", text="", expand=True)