mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-29 10:17:27 +02:00
[core] sort node types versions in file export
This commit is contained in:
parent
9a09310f07
commit
3c4ebd9b25
1 changed files with 8 additions and 4 deletions
|
@ -1292,14 +1292,18 @@ class Graph(BaseObject):
|
||||||
self.header[Graph.IO.Keys.ReleaseVersion] = meshroom.__version__
|
self.header[Graph.IO.Keys.ReleaseVersion] = meshroom.__version__
|
||||||
self.header[Graph.IO.Keys.FileVersion] = Graph.IO.__version__
|
self.header[Graph.IO.Keys.FileVersion] = Graph.IO.__version__
|
||||||
|
|
||||||
# store versions of node types present in the graph (excluding CompatibilityNode instances)
|
# Store versions of node types present in the graph (excluding CompatibilityNode instances)
|
||||||
|
# and remove duplicates
|
||||||
usedNodeTypes = set([n.nodeDesc.__class__ for n in self._nodes if isinstance(n, Node)])
|
usedNodeTypes = set([n.nodeDesc.__class__ for n in self._nodes if isinstance(n, Node)])
|
||||||
|
# Convert to node types to "name: version"
|
||||||
self.header[Graph.IO.Keys.NodesVersions] = {
|
nodesVersions = {
|
||||||
"{}".format(p.__name__): meshroom.core.nodeVersion(p, "0.0")
|
"{}".format(p.__name__): meshroom.core.nodeVersion(p, "0.0")
|
||||||
for p in usedNodeTypes
|
for p in usedNodeTypes
|
||||||
}
|
}
|
||||||
|
# Sort them by name (to avoid random order changing from one save to another)
|
||||||
|
nodesVersions = dict(sorted(nodesVersions.items()))
|
||||||
|
# Add it the header
|
||||||
|
self.header[Graph.IO.Keys.NodesVersions] = nodesVersions
|
||||||
self.header["template"] = template
|
self.header["template"] = template
|
||||||
|
|
||||||
data = {}
|
data = {}
|
||||||
|
|
Loading…
Add table
Reference in a new issue