-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graph fails on name conflicts across namespaces #1871
Comments
Hi @dgovil , |
That's good to know, thanks. I edited the issue title accordingly. |
Hey @niklasharrysson , I looked at the code a bit and it's the same issue we've discussed before -- that of lack of appropriate // We have a node downstream
ShaderNode* downstream = getNode(downstreamNode->getName());
if (downstream && connectingElement)
{
ShaderInput* input = downstream->getInput(connectingElement->getName());
if (!input)
{
throw ExceptionShaderGenError("Could not find an input named '" + connectingElement->getName() +
"' on downstream node '" + downstream->getName() + "'");
}
input->makeConnection(output);
}
|
Hey @kwokcb , thanks for investigating. And yes, this will be resolved when we get to updating the ShaderGraph to keep all graph hierarchies. |
I was hitting a bug where some code was passing EMPTY_STRING to the node creation function. This is meant to generate a name that is unique to this node.
However if I create most of my nodes within a node graph, and then create a node outside the graph, the names will conflict. I'll get two
node1
nodes.While my assumption is that nodes are namespaced by their container, this appears to still cause issues if the output material tries to connect to the output of node1.
The graph then fails because it is unsure which of the two node1's it should connect to.
I propose that the auto name algorithm should make the node names conflict free across the full topology OR that the connection algorithm pick the node at the correct namespace level instead.
Here's an example graph that is generated using purely the auto-naming code
Notice that both the surface node and the multiply node share a name. When I pull this mtlx file into MaterialXView, it errors because the surface material finds the first node with that name, not the first node within the same namespace.
The text was updated successfully, but these errors were encountered: