mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-21 13:06:28 +02:00
[core] in case of CompatibilityNode the dynamic output attributes does not exist as they are not saved in the project
So we always check if they exist before accessing them.
This commit is contained in:
parent
77571dca38
commit
972d5751e1
1 changed files with 12 additions and 3 deletions
|
@ -1023,7 +1023,10 @@ class BaseNode(BaseObject):
|
|||
# logging.warning("resetOutputAttr: {}".format(self.name))
|
||||
for output in self.nodeDesc.outputs:
|
||||
if output.isDynamicValue:
|
||||
self.attribute(output.name).value = None
|
||||
if self.hasAttribute(output.name):
|
||||
self.attribute(output.name).value = None
|
||||
else:
|
||||
logging.warning(f"resetOutputAttr: Missing dynamic output attribute: {self.name}.{output.name}")
|
||||
|
||||
def loadOutputAttr(self):
|
||||
""" Load output attributes with dynamic values from a values.json file.
|
||||
|
@ -1042,7 +1045,10 @@ class BaseNode(BaseObject):
|
|||
# logging.warning(data)
|
||||
for output in self.nodeDesc.outputs:
|
||||
if output.isDynamicValue:
|
||||
self.attribute(output.name).value = data[output.name]
|
||||
if self.hasAttribute(output.name):
|
||||
self.attribute(output.name).value = data[output.name]
|
||||
else:
|
||||
logging.warning(f"loadOutputAttr: Missing dynamic output attribute: {self.name}.{output.name}")
|
||||
|
||||
def saveOutputAttr(self):
|
||||
""" Save output attributes with dynamic values into a values.json file.
|
||||
|
@ -1052,7 +1058,10 @@ class BaseNode(BaseObject):
|
|||
data = {}
|
||||
for output in self.nodeDesc.outputs:
|
||||
if output.isDynamicValue:
|
||||
data[output.name] = self.attribute(output.name).value
|
||||
if self.hasAttribute(output.name):
|
||||
data[output.name] = self.attribute(output.name).value
|
||||
else:
|
||||
logging.warning(f"saveOutputAttr: Missing dynamic output attribute: {self.name}.{output.name}")
|
||||
|
||||
valuesFile = self.valuesFile
|
||||
# logging.warning("save output attr: {}, value: {}".format(self.name, valuesFile))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue