Skip to content

Commit

Permalink
[core] Raise compatibility issue if nodes miss invalidating internal …
Browse files Browse the repository at this point in the history
…attributes
  • Loading branch information
cbentejac committed Nov 18, 2022
1 parent cde7ec8 commit bdb5097
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions meshroom/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1583,6 +1583,19 @@ def nodeFactory(nodeDict, name=None, template=False):
sorted([attr.name for attr in nodeDesc.outputs]) != sorted(outputs.keys())):
compatibilityIssue = CompatibilityIssue.DescriptionConflict

# check whether there are any internal attributes that are invalidating in the node description: if there
# are, then check that these internal attributes are part of nodeDict; if they are not, a compatibility
# issue must be raised to warn the user, as this will automatically change the node's UID
if not template:
invalidatingIntInputs = []
for attr in nodeDesc.internalInputs:
if attr.uid == [0]:
invalidatingIntInputs.append(attr.name)
for attr in invalidatingIntInputs:
if attr not in internalInputs.keys():
compatibilityIssue = CompatibilityIssue.DescriptionConflict
break

# verify that all inputs match their descriptions
for attrName, value in inputs.items():
if not CompatibilityNode.attributeDescFromName(nodeDesc.inputs, attrName, value):
Expand Down

0 comments on commit bdb5097

Please sign in to comment.