Skip to content

Commit

Permalink
Add targets and families based on conditions
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
jakubjezek001 committed Sep 25, 2024
1 parent b605102 commit 9453ba1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/ayon_traypublisher/csv_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
11 changes: 11 additions & 0 deletions client/ayon_traypublisher/plugins/create/create_csv_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9453ba1

Please sign in to comment.