mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-29 08:56:33 +02:00
[core] introduce CompatibilityNode for improved scene compatibilities
Improve node serialization/deserialization to be able to recreate the exact same node in the graph when loading a meshroom project, even if the corresponding node's description has changed or does not exist anymore. This allows to recover already computed data on disk, without being impacted by changed uids. CompatibilityNode also provides an on-demand upgrade system to turn into a Node that meets the current node description (if possible). * new abstract class BaseNode, base class for Node and CompatibiliyNode * Node: serialize everything needed to spawn a CompatibilityNode with precomputed outputs: inputs, uids, parallelization settings, unresolved internal folders and outputs * node_factory: handles node deserialization and compatibility issues to create either a Node or a CompatibilityNode * add compatibility unit tests
This commit is contained in:
parent
b6cbb0cc63
commit
33eb7f3a7f
6 changed files with 458 additions and 101 deletions
|
@ -7,6 +7,7 @@ from PySide2.QtCore import Property, Signal
|
|||
|
||||
from meshroom.core.attribute import ListAttribute, Attribute
|
||||
from meshroom.core.graph import GraphModification
|
||||
from meshroom.core.node import node_factory
|
||||
|
||||
|
||||
class UndoCommand(QUndoCommand):
|
||||
|
@ -125,8 +126,8 @@ class RemoveNodeCommand(GraphCommand):
|
|||
|
||||
def undoImpl(self):
|
||||
with GraphModification(self.graph):
|
||||
node = self.graph.addNewNode(nodeType=self.nodeDict["nodeType"],
|
||||
name=self.nodeName, **self.nodeDict["attributes"])
|
||||
node = node_factory(self.nodeDict, self.nodeName)
|
||||
self.graph.addNode(node, self.nodeName)
|
||||
assert (node.getName() == self.nodeName)
|
||||
# recreate out edges deleted on node removal
|
||||
for dstAttr, srcAttr in self.outEdges.items():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue