Rework to avoid csv_ingest_shot family.

This commit is contained in:
robin@ynput.io 2024-11-18 13:38:21 -05:00
parent a69d60f9d4
commit 4a4377b489
2 changed files with 32 additions and 23 deletions

View file

@ -31,18 +31,14 @@ class CollectHierarchy(pyblish.api.ContextPlugin):
product_type = instance.data["productType"] product_type = instance.data["productType"]
families = instance.data["families"] families = instance.data["families"]
# exclude other families then self.families with intersection # exclude other families then "shot" with intersection
if not set(self.families).intersection( if "shot" not in (families + [product_type]):
set(families + [product_type]) self.log.debug("Skipping not a shot: {}".format(families))
):
continue continue
# Skip if is not a hero track # Skip if is not a hero track
# - skip check for traypubliser CSV ingest if not instance.data.get("heroTrack"):
if ( self.log.debug("Skipping not a shot from hero track")
not instance.data.get("heroTrack")
and "csv_ingest_shot" not in families
):
continue continue
shot_data = { shot_data = {
@ -54,20 +50,29 @@ class CollectHierarchy(pyblish.api.ContextPlugin):
"comments": instance.data.get("comments", []), "comments": instance.data.get("comments", []),
} }
# TODO Fill in reason why we don't set attributes for csv_ingest_shot shot_data["attributes"] = {}
if "csv_ingest_shot" not in families: SHOT_ATTRS = (
shot_data["attributes"] = { "handleStart",
"handleStart": instance.data["handleStart"], "handleEnd",
"handleEnd": instance.data["handleEnd"], "frameStart",
"frameStart": instance.data["frameStart"], "frameEnd",
"frameEnd": instance.data["frameEnd"], "clipIn",
"clipIn": instance.data["clipIn"], "clipOut",
"clipOut": instance.data["clipOut"], "fps",
"fps": instance.data["fps"], "resolutionWidth",
"resolutionWidth": instance.data["resolutionWidth"], "resolutionHeight",
"resolutionHeight": instance.data["resolutionHeight"], "pixelAspect",
"pixelAspect": instance.data["pixelAspect"], )
} for shot_attr in SHOT_ATTRS:
if shot_attr not in instance.data:
# Shot attribute might not be defined (e.g. CSV ingest)
self.log.debug(
"%s shot attribute is not defined for instance.",
shot_attr
)
continue
shot_data["attributes"][shot_attr] = instance.data[shot_attr]
# Split by '/' for AYON where asset is a path # Split by '/' for AYON where asset is a path
name = instance.data["folderPath"].split("/")[-1] name = instance.data["folderPath"].split("/")[-1]

View file

@ -29,6 +29,10 @@ class CollectOtioFrameRanges(pyblish.api.InstancePlugin):
otio_range_with_handles otio_range_with_handles
) )
if not instance.data.get("otioClip"):
self.log.debug("Skipping collect OTIO frame range.")
return
# get basic variables # get basic variables
otio_clip = instance.data["otioClip"] otio_clip = instance.data["otioClip"]
workfile_start = instance.data["workfileFrameStart"] workfile_start = instance.data["workfileFrameStart"]