Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3024 from pypeclub/bugfix/OP-2837_Customizable-su…
Browse files Browse the repository at this point in the history
…bset-name-for-workfiles-Harmony

Harmony: Added creating subset name for workfile from template
  • Loading branch information
kalisp authored Apr 6, 2022
2 parents 3052cf6 + 57404e5 commit 95af632
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions openpype/hosts/harmony/plugins/publish/collect_workfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import pyblish.api
import os

from openpype.lib import get_subset_name_with_asset_doc


class CollectWorkfile(pyblish.api.ContextPlugin):
"""Collect current script for publish."""
Expand All @@ -14,10 +16,15 @@ class CollectWorkfile(pyblish.api.ContextPlugin):
def process(self, context):
"""Plugin entry point."""
family = "workfile"
task = os.getenv("AVALON_TASK", None)
sanitized_task_name = task[0].upper() + task[1:]
basename = os.path.basename(context.data["currentFile"])
subset = "{}{}".format(family, sanitized_task_name)
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"]
)

# Create instance
instance = context.create_instance(subset)
Expand Down

0 comments on commit 95af632

Please sign in to comment.