[core] invalidate= becomes optional and is set to True by default

This will allow to simplify node descriptions as most of the attributes
are generally invalidating. Only non-invalidating attributes will need
to state explicitly `invalidate=False`.

For output attributes, which must not be invalidating, `invalidate` will
be automatically set to `False` at the attribute-level if it is set to
`True` in the description.
This commit is contained in:
Candice Bentéjac 2024-09-06 15:11:39 +02:00
parent 41e885d9ff
commit b981ef651c
3 changed files with 53 additions and 54 deletions

View file

@ -1423,15 +1423,12 @@ class Node(BaseNode):
# List attributes per UID
for attr in self._attributes:
if attr.isInput and attr.attributeDesc.invalidate:
if attr.isInput and attr.invalidate:
self.invalidatingAttributes.add(attr)
else:
if attr.attributeDesc.invalidate:
logging.error(f"Output Attribute should not be invalidating: '{nodeType}.{attr.name}'")
# Add internal attributes with a UID to the list
for attr in self._internalAttributes:
if attr.attributeDesc.invalidate:
if attr.invalidate:
self.invalidatingAttributes.add(attr)
self.optionalCallOnDescriptor("onNodeCreated")