Render: make Cycles and Evee support each other's output material nodes.

This changes the Cycles exporting and Cycles/Eevee UI code to support both
output material nodes, giving priority to the renderer native one. Still
missing is Eevee code to prefer the Eevee output node.
This commit is contained in:
Brecht Van Lommel
2017-08-01 18:03:16 +02:00
parent 110d6832a8
commit c42c129393
7 changed files with 85 additions and 66 deletions

View File

@@ -1120,10 +1120,12 @@ def panel_node_draw(layout, ntree, output_type):
if node:
input = find_node_input(node, 'Surface')
layout.template_node_view(ntree, node, input)
return True
return False
if input:
layout.template_node_view(ntree, node, input)
else:
layout.label(text="Incompatible output node")
else:
layout.label(text="No output node")
class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel):
@@ -1145,8 +1147,7 @@ class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel):
layout.separator()
if mat.use_nodes:
if not panel_node_draw(layout, mat.node_tree, 'OUTPUT_EEVEE_MATERIAL'):
layout.label(text="No output node")
panel_node_draw(layout, mat.node_tree, ['OUTPUT_EEVEE_MATERIAL', 'OUTPUT_MATERIAL'])
else:
raym = mat.raytrace_mirror
layout.prop(mat, "diffuse_color", text="Base Color")