Skip to content

Commit e0b2aaf

Browse files
committed
[core] Attribute: Strip ending "/" from invalidation values
By doing so, invalidation values will evaluate to the same UID independently from whether the attribute's value has been written with an extra "/" or not.
1 parent 8afc9ad commit e0b2aaf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

meshroom/core/attribute.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,11 @@ def uid(self):
276276
# To guarantee that each output attribute receives a unique ID, we add the attribute name to it.
277277
return hashValue((self.name, self.node._uid))
278278
else:
279-
# only dependent on the hash of its value without the cache folder
280-
return hashValue(self._invalidationValue)
279+
# Only dependent on the hash of its value without the cache folder.
280+
# "/" at the end of the link is stripped to prevent having different UIDs depending on
281+
# whether the invalidation value finishes with it or not
282+
strippedInvalidationValue = self._invalidationValue.rstrip("/")
283+
return hashValue(strippedInvalidationValue)
281284
if self.isLink:
282285
linkParam = self.getLinkParam(recursive=True)
283286
return linkParam.uid()

0 commit comments

Comments
 (0)