[Bf-blender-cvs] [5b33115] master: Cycles: Fix wrong assert failure happening after recent de-duplicate

Sergey Sharybin noreply at git.blender.org
Tue Dec 15 17:04:25 CET 2015


Commit: 5b331150709616fc5aee9c1af228d48175032ea0
Author: Sergey Sharybin
Date:   Tue Dec 15 21:01:56 2015 +0500
Branches: master
https://developer.blender.org/rB5b331150709616fc5aee9c1af228d48175032ea0

Cycles: Fix wrong assert failure happening after recent de-duplicate

This is actually intended behavior to return NULL when the socket is not
found. It's used in certain BSDF nodes to query whether some inputs exists
or not.

Perhaps we can be more explicit here and have dedicated logic to query
socket existance and keep assert in place.

In any case, even if we lost assert() for the constant fold now it's
still somewhat better than duplicated code. Perhaps.

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

M	intern/cycles/render/graph.cpp

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

diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp
index e177cd5..7bffb29 100644
--- a/intern/cycles/render/graph.cpp
+++ b/intern/cycles/render/graph.cpp
@@ -100,7 +100,7 @@ ShaderInput *ShaderNode::input(const char *name)
 		if(strcmp(socket->name, name) == 0)
 			return socket;
 	}
-	assert(!"Requested shader input does not exist");
+
 	return NULL;
 }
 
@@ -109,7 +109,7 @@ ShaderOutput *ShaderNode::output(const char *name)
 	foreach(ShaderOutput *socket, outputs)
 		if(strcmp(socket->name, name) == 0)
 			return socket;
-	assert(!"Requested shader output does not exist");
+
 	return NULL;
 }




More information about the Bf-blender-cvs mailing list