mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-16 00:05:26 +02:00
[core] update UID computation to take into account the particular case of dynamic output attributes
For dynamic output attributes, the UID does not depend on the attribute value. In particular, when loading a project file, the UIDs are updated first, and the node status and the dynamic output values are not yet loaded, so we should not read the attribute value.
This commit is contained in:
parent
0e5be25d97
commit
cc6f75f2d4
1 changed files with 12 additions and 1 deletions
|
@ -705,7 +705,18 @@ class BaseNode(BaseObject):
|
|||
# For now, the only index that is used is "0", so there will be a single iteration of the loop below
|
||||
for uidIndex, associatedAttributes in self.attributesPerUid.items():
|
||||
# UID is computed by hashing the sorted list of tuple (name, value) of all attributes impacting this UID
|
||||
uidAttributes = [(a.getName(), a.uid(uidIndex)) for a in associatedAttributes if a.enabled and a.value != a.uidIgnoreValue]
|
||||
uidAttributes = []
|
||||
for a in associatedAttributes:
|
||||
if not a.enabled:
|
||||
continue # disabled params do not contribute to the uid
|
||||
dynamicOutputAttr = a.isLink and a.getLinkParam(recursive=True).desc.isDynamicValue
|
||||
# For dynamic output attributes, the UID does not depend on the attribute value.
|
||||
# In particular, when loading a project file, the UIDs are updated first,
|
||||
# and the node status and the dynamic output values are not yet loaded,
|
||||
# so we should not read the attribute value.
|
||||
if not dynamicOutputAttr and a.value == a.uidIgnoreValue:
|
||||
continue # for non-dynamic attributes, check if the value should be ignored
|
||||
uidAttributes.append((a.getName(), a.uid(uidIndex)))
|
||||
uidAttributes.sort()
|
||||
# Adding the node type prevents ending up with two identical UIDs for different node types that have the exact same list of attributes
|
||||
uidAttributes.append(self.nodeType)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue