diff options
author | Luca Rood <dev@lucarood.com> | 2017-06-19 17:31:10 +0300 |
---|---|---|
committer | Luca Rood <dev@lucarood.com> | 2017-06-20 19:39:49 +0300 |
commit | aaf37e1216b2a9dfc43591e227c679a5b35af8c0 (patch) | |
tree | ca02bf03d24e919ca55c5475eb98deda91804543 /source/blender/editors/space_node/node_edit.c | |
parent | c2f4308e6ba21d4bcbed0aa36b6c770967160771 (diff) |
Implement Eevee output node system
This makes Eevee consistent with Cycles, by having a single output node,
and multiple shader nodes that connect to it.
Note that node systems for Eevee saved before this will be missing the
output node, and thus will show an invalid material. This is easily
resolved by connecting the shader output to a new output node.
Diffstat (limited to 'source/blender/editors/space_node/node_edit.c')
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index c70cbeef52f..9ad40ea802e 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -399,14 +399,10 @@ void ED_node_shader_default(const bContext *C, ID *id) ma->nodetree = ntree; if (BKE_scene_uses_blender_eevee(scene)) { - out = nodeAddStaticNode(C, ntree, SH_NODE_OUTPUT_METALLIC); - out->locx = 300.0f; out->locy = 300.0f; - nodeSetActive(ntree, out); - ntreeUpdateTree(CTX_data_main(C), ntree); - return; + output_type = SH_NODE_OUTPUT_EEVEE_MATERIAL; + shader_type = SH_NODE_OUTPUT_METALLIC; } - - if (BKE_scene_use_new_shading_nodes(scene)) { + else if (BKE_scene_use_new_shading_nodes(scene)) { output_type = SH_NODE_OUTPUT_MATERIAL; shader_type = SH_NODE_BSDF_DIFFUSE; } |