Commit: e44fa4e6a9ec839f1ee2abca785261ecc78dff2b
Author: Brecht Van Lommel
Date:   Thu Jul 21 04:38:55 2016 +0200
Branches: master
https://developer.blender.org/rBe44fa4e6a9ec839f1ee2abca785261ecc78dff2b

Fix another Cycles OSL script node issue with shaders using bump.

===================================================================

M       intern/cycles/render/graph.cpp

===================================================================

diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp
index ac78238..66601fa 100644
--- a/intern/cycles/render/graph.cpp
+++ b/intern/cycles/render/graph.cpp
@@ -374,24 +374,12 @@ void ShaderGraph::copy_nodes(ShaderNodeSet& nodes, 
ShaderNodeMap& nnodemap)
                ShaderNode *nnode = node->clone();
                nnodemap[node] = nnode;
 
+               /* create new inputs and outputs to recreate links and ensure
+                * that we still point to valid SocketType if the NodeType
+                * changed in cloning, as it does for OSL nodes */
                nnode->inputs.clear();
                nnode->outputs.clear();
-
-               foreach(ShaderInput *input, node->inputs) {
-                       ShaderInput *ninput = new ShaderInput(*input);
-                       nnode->inputs.push_back(ninput);
-
-                       ninput->parent = nnode;
-                       ninput->link = NULL;
-               }
-
-               foreach(ShaderOutput *output, node->outputs) {
-                       ShaderOutput *noutput = new ShaderOutput(*output);
-                       nnode->outputs.push_back(noutput);
-
-                       noutput->parent = nnode;
-                       noutput->links.clear();
-               }
+               nnode->create_inputs_outputs(nnode->type);
        }
 
        /* recreate links */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to