mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-29 02:08:08 +02:00
[core][node] serialization: rename 'attributes' to 'inputs'
This commit is contained in:
parent
33eb7f3a7f
commit
1d309136ec
3 changed files with 6 additions and 5 deletions
|
@ -630,7 +630,7 @@ class Node(BaseNode):
|
|||
},
|
||||
'uids': self._uids,
|
||||
'internalFolder': self._internalFolder,
|
||||
'attributes': {k: v for k, v in inputs.items() if v is not None}, # filter empty values
|
||||
'inputs': {k: v for k, v in inputs.items() if v is not None}, # filter empty values
|
||||
'outputs': outputs,
|
||||
}
|
||||
|
||||
|
|
|
@ -299,9 +299,9 @@ class UIGraph(QObject):
|
|||
with self.groupedGraphModification("Duplicate Node {}".format(srcNode.name)):
|
||||
# skip edges: filter out attributes which are links
|
||||
if not createEdges:
|
||||
serialized["attributes"] = {k: v for k, v in serialized["attributes"].items() if not Attribute.isLinkExpression(v)}
|
||||
serialized["inputs"] = {k: v for k, v in serialized["inputs"].items() if not Attribute.isLinkExpression(v)}
|
||||
# create a new node of the same type and with the same attributes values
|
||||
node = self.addNewNode(serialized["nodeType"], **serialized["attributes"])
|
||||
node = self.addNewNode(serialized["nodeType"], **serialized["inputs"])
|
||||
return node
|
||||
|
||||
def duplicateNodesFromNode(self, fromNode):
|
||||
|
@ -326,7 +326,7 @@ class UIGraph(QObject):
|
|||
# re-create edges taking into account what has been duplicated
|
||||
for srcNode, duplicate in duplicates.items():
|
||||
# get link attributes
|
||||
links = {k: v for k, v in srcNode.toDict()["attributes"].items() if Attribute.isLinkExpression(v)}
|
||||
links = {k: v for k, v in srcNode.toDict()["inputs"].items() if Attribute.isLinkExpression(v)}
|
||||
for attr, link in links.items():
|
||||
link = link[1:-1] # remove starting '{' and trailing '}'
|
||||
# get source node and attribute name
|
||||
|
|
|
@ -356,7 +356,8 @@ class Reconstruction(UIGraph):
|
|||
# If cameraInit is None (i.e: SfM augmentation):
|
||||
# * create an uninitialized node
|
||||
# * wait for the result before actually creating new nodes in the graph (see onIntrinsicsAvailable)
|
||||
cameraInitCopy = node_factory(cameraInit.toDict())
|
||||
inputs = cameraInit.toDict()["inputs"] if cameraInit else {}
|
||||
cameraInitCopy = Node("CameraInit", **inputs)
|
||||
|
||||
try:
|
||||
self.setBuildingIntrinsics(True)
|
||||
|
|
Loading…
Add table
Reference in a new issue