From 9453ba105667f0f662cd2060cd125c6a63aab7ae Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 25 Sep 2024 14:07:31 +0200 Subject: [PATCH] Add targets and families based on conditions - Added a new variable 'targets' with a default value of None in the csvpublish function. - Introduced a new boolean variable 'is_reviewable' to check for specific tags in repre_items and modify families accordingly. --- client/ayon_traypublisher/csv_publish.py | 1 + .../plugins/create/create_csv_ingest.py | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/client/ayon_traypublisher/csv_publish.py b/client/ayon_traypublisher/csv_publish.py index b7906c5..0c44aeb 100644 --- a/client/ayon_traypublisher/csv_publish.py +++ b/client/ayon_traypublisher/csv_publish.py @@ -76,6 +76,7 @@ def csvpublish( pyblish_context = pyblish.api.Context() pyblish_context.data["create_context"] = create_context + targets = None # redefine targets (skip 'local' to disable validators) if ignore_validators: targets = ["default", "ingest"] diff --git a/client/ayon_traypublisher/plugins/create/create_csv_ingest.py b/client/ayon_traypublisher/plugins/create/create_csv_ingest.py index fd4dedd..b00ef1d 100644 --- a/client/ayon_traypublisher/plugins/create/create_csv_ingest.py +++ b/client/ayon_traypublisher/plugins/create/create_csv_ingest.py @@ -770,17 +770,28 @@ def _create_instances_from_csv_data(self, csv_dir: str, filename: str): ), None ) + slate_exists: bool = any( repre_item.slate_exists for repre_item in repre_items ) + is_reviewable: bool = any( + True + for repre_item in repre_items + if "review" in repre_item.tags + ) + families: List[str] = ["csv_ingest"] if slate_exists: # adding slate to families mainly for loaders to be able # to filter out slates families.append("slate") + if is_reviewable: + # review family needs to be added for ExtractReview plugin + families.append("review") + instance_data = { "name": product_item.instance_name, "folderPath": folder_path,