Fix: Various mishandling of node identifiers and vector
In a few places, nodes were added without updating the Identifiers and vector. In other places nodes we removed without removing from and rebuilding the vector. This is solved in a few ways. First I exposed a function to rebuild the vector from scratch, and added unique ID finding to a few places. The changes to node group building and separating are more involved, mostly because it was hard to see the correct behavior without some refactoring. Now `VectorSet` is used to store nodes involved in the operation. Some things are handled more simply with the topology cache and by passing a span of nodes.
This commit is contained in:
@@ -446,10 +446,12 @@ static void flatten_group_do(bNodeTree *ntree, bNode *gnode)
|
||||
/* migrate node */
|
||||
BLI_remlink(&ngroup->nodes, node);
|
||||
BLI_addtail(&ntree->nodes, node);
|
||||
nodeUniqueID(ntree, node);
|
||||
/* ensure unique node name in the node tree */
|
||||
/* This is very slow and it has no use for GPU nodetree. (see T70609) */
|
||||
// nodeUniqueName(ntree, node);
|
||||
}
|
||||
ngroup->runtime->nodes_by_id.clear();
|
||||
|
||||
/* Save first and last link to iterate over flattened group links. */
|
||||
bNodeLink *glinks_first = static_cast<bNodeLink *>(ntree->links.last);
|
||||
|
||||
Reference in New Issue
Block a user