Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions meshroom/core/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 13 additions & 0 deletions meshroom/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand All @@ -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():
Expand Down