Author Topic: Duplicate as unique  (Read 218 times)

`createIterationOnPattern` allows for duplicating multiple nodes by their UID, intelligently creating the connections which is great. It seems to duplicate an instance rather than support new unique instances. I used the method where one of the nodes duplicated was an input node, all it's copies used the same identifier string which when updated affected all other inputs, so the graph only saw it as a single input.

It would be great to support unique copies with their own identifiers, just like how substance will create a new input node with default text appending a number so that the identifier is unique. I can create these nodes in a loop with manual connection calls, the iteration method was just a nice convenience.

Indeed, createIterationOnPattern was not designed to handle input nodes so the uniqueness of input identifier is not checked, but this could be seen as an issue, and we should fix it.

However, when you create an input/output node, the API, as SD does, ensures that you have unique identifiers and add a suffix to the provided identifier if necessary. So you can have a loop for creating input nodes without caring for unique identifiers on your side.