mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-02 16:28:51 +02:00
[graph] sort nodes by index when loading graph file
This commit is contained in:
parent
1bc6168814
commit
530af4d905
1 changed files with 2 additions and 1 deletions
|
@ -1123,7 +1123,8 @@ class Graph(BaseObject):
|
|||
raise RuntimeError('loadGraph error: Graph is not a dict. File: {}'.format(filepath))
|
||||
|
||||
with GraphModification(self):
|
||||
for nodeName, nodeData in graphData.items():
|
||||
# iterate over nodes sorted by suffix index in their names
|
||||
for nodeName, nodeData in sorted(graphData.items(), key=lambda x: self.getNodeIndexFromName(x[0])):
|
||||
if not isinstance(nodeData, dict):
|
||||
raise RuntimeError('loadGraph error: Node is not a dict. File: {}'.format(filepath))
|
||||
n = Node(nodeData['nodeType'], **nodeData['attributes'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue