Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2014-09-19 15:21:25 +0400
committerThomas Dinges <blender@dingto.org>2014-09-19 15:21:25 +0400
commit75b61f5346fbf05d64a90b17f70b096b1a690f3e (patch)
tree124e9965bc7ddcd96a724c3f8c4a1e0469e73fe5 /intern
parent40a1c7b9c78b2790cf34e7428561ebfcf20002e0 (diff)
Cycles: Remove unused Mix Shaders from the ShaderGraph, instead of only relinking.
Differential revision: https://developer.blender.org/D796
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/render/graph.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp
index 0ff904d06e7..904060c30e7 100644
--- a/intern/cycles/render/graph.cpp
+++ b/intern/cycles/render/graph.cpp
@@ -391,6 +391,8 @@ void ShaderGraph::remove_unneeded_nodes()
if(output)
connect(output, input);
}
+ removed[mix->id] = true;
+ any_node_removed = true;
}
/* remove unused mix closure input when factor is 0.0 or 1.0 */
@@ -410,6 +412,8 @@ void ShaderGraph::remove_unneeded_nodes()
if(output)
connect(output, input);
}
+ removed[mix->id] = true;
+ any_node_removed = true;
}
/* factor 1.0 */
else if(mix->inputs[0]->value.x == 1.0f) {
@@ -425,13 +429,15 @@ void ShaderGraph::remove_unneeded_nodes()
if(output)
connect(output, input);
}
+ removed[mix->id] = true;
+ any_node_removed = true;
}
}
}
}
/* remove nodes */
- if (any_node_removed) {
+ if(any_node_removed) {
list<ShaderNode*> newnodes;
foreach(ShaderNode *node, nodes) {