diff --git a/meshroom/core/graph.py b/meshroom/core/graph.py index 099a8ad658..a2039e72f1 100644 --- a/meshroom/core/graph.py +++ b/meshroom/core/graph.py @@ -617,6 +617,7 @@ def pasteNodes(self, data, position): attributes = {} attributes.update(data[key].get("inputs", {})) attributes.update(data[key].get("outputs", {})) + attributes.update(data[key].get("internalInputs", {})) node = Node(nodeType, position=position[positionCnt], **attributes) self._addNode(node, key) diff --git a/meshroom/core/node.py b/meshroom/core/node.py index c7287a23ee..6a1d016c36 100644 --- a/meshroom/core/node.py +++ b/meshroom/core/node.py @@ -1258,6 +1258,7 @@ def __init__(self, nodeType, position=None, parent=None, **kwargs): self.attributesPerUid[uidIndex].add(attr) self.setAttributeValues(kwargs) + self.setInternalAttributeValues(kwargs) self.optionalCallOnDescriptor("onNodeCreated") def optionalCallOnDescriptor(self, methodName, *args, **kwargs): @@ -1270,6 +1271,9 @@ def optionalCallOnDescriptor(self, methodName, *args, **kwargs): def setAttributeValues(self, values): # initialize attribute values for k, v in values.items(): + if not self.hasAttribute(k): + # skip missing attributes + continue attr = self.attribute(k) if attr.isInput: attr.value = v @@ -1287,6 +1291,15 @@ def upgradeAttributeValues(self, values): except ValueError: pass + def setInternalAttributeValues(self, values): + # initialize internal attribute values + for k, v in values.items(): + if not self.hasInternalAttribute(k): + # skip missing attributes + continue + attr = self.internalAttribute(k) + attr.value = v + def upgradeInternalAttributeValues(self, values): # initialize internal attibute values for k, v in values.items():