Apply suggestions from code review

Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
This commit is contained in:
Robin De Lillo 2024-11-19 08:07:52 -05:00 committed by GitHub
parent ff56393da8
commit 83cc964ca0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,7 +64,8 @@ class CollectHierarchy(pyblish.api.ContextPlugin):
"pixelAspect",
)
for shot_attr in SHOT_ATTRS:
if shot_attr not in instance.data:
attr_value = instance.data.get(shot_attr)
if attr_value is None:
# Shot attribute might not be defined (e.g. CSV ingest)
self.log.debug(
"%s shot attribute is not defined for instance.",
@ -72,7 +73,7 @@ class CollectHierarchy(pyblish.api.ContextPlugin):
)
continue
shot_data["attributes"][shot_attr] = instance.data[shot_attr]
shot_data["attributes"][shot_attr] = attr_value
# Split by '/' for AYON where asset is a path
name = instance.data["folderPath"].split("/")[-1]