Merge pull request #2969 from pypeclub/bugfix/PS_review_subset_name

Photoshop: Fix creation of subset names in PS review and workfile
This commit is contained in:
Petr Kalis 2022-04-01 11:21:14 +02:00 committed by GitHub
commit e5d35e6593
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 5 deletions

View file

@ -2,18 +2,26 @@ import os
import pyblish.api
from openpype.lib import get_subset_name_with_asset_doc
class CollectReview(pyblish.api.ContextPlugin):
"""Gather the active document as review instance."""
label = "Review"
order = pyblish.api.CollectorOrder
order = pyblish.api.CollectorOrder + 0.1
hosts = ["photoshop"]
def process(self, context):
family = "review"
task = os.getenv("AVALON_TASK", None)
subset = family + task.capitalize()
subset = get_subset_name_with_asset_doc(
family,
"",
context.data["anatomyData"]["task"]["name"],
context.data["assetEntity"],
context.data["anatomyData"]["project"]["name"],
host_name=context.data["hostName"]
)
file_path = context.data["currentFile"]
base_name = os.path.basename(file_path)

View file

@ -1,6 +1,8 @@
import os
import pyblish.api
from openpype.lib import get_subset_name_with_asset_doc
class CollectWorkfile(pyblish.api.ContextPlugin):
"""Collect current script for publish."""
@ -11,8 +13,14 @@ class CollectWorkfile(pyblish.api.ContextPlugin):
def process(self, context):
family = "workfile"
task = os.getenv("AVALON_TASK", None)
subset = family + task.capitalize()
subset = get_subset_name_with_asset_doc(
family,
"",
context.data["anatomyData"]["task"]["name"],
context.data["assetEntity"],
context.data["anatomyData"]["project"]["name"],
host_name=context.data["hostName"]
)
file_path = context.data["currentFile"]
staging_dir = os.path.dirname(file_path)