mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-19 12:06:28 +02:00
Store all duplicates of a node correctly upon their creation
Duplicates used to be stored in a dictionary with an entry being "parent node": "duplicated node". On occasions where a single parent node was duplicated more than once, the latest duplicated node erased the previous one(s), and these older ones were "lost": after being created, there was no trace left of their existence in the duplication operation. Undoing that duplication operation was thus leaving these duplicated nodes out and not removing them. Duplicated nodes are now stored as "parent node": [list of duplicated nodes] to keep track of all the created nodes, effectively removing them upon an "undo".
This commit is contained in:
parent
09fc117c65
commit
b77274a027
3 changed files with 17 additions and 12 deletions
|
@ -184,7 +184,8 @@ class DuplicateNodesCommand(GraphCommand):
|
|||
|
||||
def redoImpl(self):
|
||||
srcNodes = [ self.graph.node(i) for i in self.srcNodeNames ]
|
||||
duplicates = list(self.graph.duplicateNodes(srcNodes).values())
|
||||
# flatten the list of duplicated nodes to avoid lists within the list
|
||||
duplicates = [ n for nodes in list(self.graph.duplicateNodes(srcNodes).values()) for n in nodes ]
|
||||
self.duplicates = [ n.name for n in duplicates ]
|
||||
return duplicates
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue