mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-19 17:47:25 +02:00
[core][graph] store duplication result in an OrderedDict
allows to keep the order in which duplicated nodes were created
This commit is contained in:
parent
e6e2c18aa8
commit
41ea5a5423
1 changed files with 4 additions and 3 deletions
|
@ -5,7 +5,7 @@ import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import weakref
|
import weakref
|
||||||
from collections import defaultdict
|
from collections import defaultdict, OrderedDict
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
@ -363,10 +363,11 @@ class Graph(BaseObject):
|
||||||
fromNode (Node): the node to start the duplication from
|
fromNode (Node): the node to start the duplication from
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Dict[Node, Node]: the source->duplicate map
|
OrderedDict[Node, Node]: the source->duplicate map
|
||||||
"""
|
"""
|
||||||
srcNodes, srcEdges = self.nodesFromNode(fromNode)
|
srcNodes, srcEdges = self.nodesFromNode(fromNode)
|
||||||
duplicates = {}
|
# use OrderedDict to keep duplicated nodes creation order
|
||||||
|
duplicates = OrderedDict()
|
||||||
|
|
||||||
with GraphModification(self):
|
with GraphModification(self):
|
||||||
duplicateEdges = {}
|
duplicateEdges = {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue