forked from bartvdbraak/blender
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.
This commit is contained in:
parent
baaf10cb26
commit
5b33115070
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user