[core] node dynamic output: more precise warnings

This commit is contained in:
Fabien Castan 2024-07-18 23:52:50 +02:00
parent 0e90915a82
commit a3bd0fe326

View file

@ -1064,10 +1064,13 @@ class BaseNode(BaseObject):
# logging.warning(data) # logging.warning(data)
for output in self.nodeDesc.outputs: for output in self.nodeDesc.outputs:
if output.isDynamicValue: if output.isDynamicValue:
if self.hasAttribute(output.name): if self.hasAttribute(output.name) and output.name in data:
self.attribute(output.name).value = data[output.name] self.attribute(output.name).value = data[output.name]
else: else:
logging.warning(f"loadOutputAttr: Missing dynamic output attribute: {self.name}.{output.name}") if not self.hasAttribute(output.name):
logging.warning(f"loadOutputAttr: Missing dynamic output attribute. Node={self.name}, Attribute={output.name}")
if output.name not in data:
logging.warning(f"loadOutputAttr: Missing dynamic output value in file. Node={self.name}, Attribute={output.name}, File={valuesFile}, Data keys={data.keys()}")
def saveOutputAttr(self): def saveOutputAttr(self):
""" Save output attributes with dynamic values into a values.json file. """ Save output attributes with dynamic values into a values.json file.