mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
resolve is using product name and type
This commit is contained in:
parent
00436cf904
commit
b7732dbddc
7 changed files with 61 additions and 57 deletions
|
|
@ -520,8 +520,8 @@ def imprint(timeline_item, data=None):
|
|||
Examples:
|
||||
data = {
|
||||
'folderPath': 'sq020sh0280',
|
||||
'family': 'render',
|
||||
'subset': 'subsetMain'
|
||||
'productType': 'render',
|
||||
'productName': 'productMain'
|
||||
}
|
||||
"""
|
||||
data = data or {}
|
||||
|
|
|
|||
|
|
@ -296,8 +296,8 @@ def list_instances():
|
|||
|
||||
if tag_data:
|
||||
asset = tag_data.get("asset")
|
||||
subset = tag_data.get("subset")
|
||||
tag_data["label"] = f"{ti_name} [{asset}-{subset}]"
|
||||
product_name = tag_data.get("productName")
|
||||
tag_data["label"] = f"{ti_name} [{asset}-{product_name}]"
|
||||
listed_instances.append(tag_data)
|
||||
|
||||
return listed_instances
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ class ClipLoader:
|
|||
""" Gets context and convert it to self.data
|
||||
data structure:
|
||||
{
|
||||
"name": "assetName_subsetName_representationName"
|
||||
"name": "assetName_productName_representationName"
|
||||
"binPath": "projectBinPath",
|
||||
}
|
||||
"""
|
||||
|
|
@ -358,17 +358,17 @@ class ClipLoader:
|
|||
representation = self.context["representation"]
|
||||
representation_context = representation["context"]
|
||||
asset = str(representation_context["asset"])
|
||||
subset = str(representation_context["subset"])
|
||||
product_name = str(representation_context["subset"])
|
||||
representation_name = str(representation_context["representation"])
|
||||
self.data["clip_name"] = "_".join([
|
||||
asset,
|
||||
subset,
|
||||
product_name,
|
||||
representation_name
|
||||
])
|
||||
self.data["versionData"] = self.context["version"]["data"]
|
||||
|
||||
self.data["timeline_basename"] = "timeline_{}_{}".format(
|
||||
subset, representation_name)
|
||||
product_name, representation_name)
|
||||
|
||||
# solve project bin structure path
|
||||
hierarchy = str("/".join((
|
||||
|
|
@ -603,9 +603,9 @@ class PublishClip:
|
|||
rename_default = False
|
||||
hierarchy_default = "{_folder_}/{_sequence_}/{_track_}"
|
||||
clip_name_default = "shot_{_trackIndex_:0>3}_{_clipIndex_:0>4}"
|
||||
subset_name_default = "<track_name>"
|
||||
base_product_name_default = "<track_name>"
|
||||
review_track_default = "< none >"
|
||||
subset_family_default = "plate"
|
||||
product_type_default = "plate"
|
||||
count_from_default = 10
|
||||
count_steps_default = 10
|
||||
vertical_sync_default = False
|
||||
|
|
@ -728,10 +728,10 @@ class PublishClip:
|
|||
"countFrom", {}).get("value") or self.count_from_default
|
||||
self.count_steps = self.ui_inputs.get(
|
||||
"countSteps", {}).get("value") or self.count_steps_default
|
||||
self.subset_name = self.ui_inputs.get(
|
||||
"subsetName", {}).get("value") or self.subset_name_default
|
||||
self.subset_family = self.ui_inputs.get(
|
||||
"subsetFamily", {}).get("value") or self.subset_family_default
|
||||
self.base_product_name = self.ui_inputs.get(
|
||||
"productName", {}).get("value") or self.base_product_name_default
|
||||
self.product_type = self.ui_inputs.get(
|
||||
"productType", {}).get("value") or self.product_type_default
|
||||
self.vertical_sync = self.ui_inputs.get(
|
||||
"vSyncOn", {}).get("value") or self.vertical_sync_default
|
||||
self.driving_layer = self.ui_inputs.get(
|
||||
|
|
@ -739,12 +739,14 @@ class PublishClip:
|
|||
self.review_track = self.ui_inputs.get(
|
||||
"reviewTrack", {}).get("value") or self.review_track_default
|
||||
|
||||
# build subset name from layer name
|
||||
if self.subset_name == "<track_name>":
|
||||
self.subset_name = self.track_name
|
||||
# build product name from layer name
|
||||
if self.base_product_name == "<track_name>":
|
||||
self.base_product_name = self.track_name
|
||||
|
||||
# create subset for publishing
|
||||
self.subset = self.subset_family + self.subset_name.capitalize()
|
||||
# create product name for publishing
|
||||
self.product_name = (
|
||||
self.product_type + self.base_product_name.capitalize()
|
||||
)
|
||||
|
||||
def _replace_hash_to_expression(self, name, text):
|
||||
""" Replace hash with number in correct padding. """
|
||||
|
|
@ -824,17 +826,19 @@ class PublishClip:
|
|||
# driving layer is set as negative match
|
||||
for (_in, _out), hero_data in self.vertical_clip_match.items():
|
||||
hero_data.update({"heroTrack": False})
|
||||
if _in == self.clip_in and _out == self.clip_out:
|
||||
data_subset = hero_data["subset"]
|
||||
# add track index in case duplicity of names in hero data
|
||||
if self.subset in data_subset:
|
||||
hero_data["subset"] = self.subset + str(
|
||||
self.track_index)
|
||||
# in case track name and subset name is the same then add
|
||||
if self.subset_name == self.track_name:
|
||||
hero_data["subset"] = self.subset
|
||||
# assign data to return hierarchy data to tag
|
||||
tag_hierarchy_data = hero_data
|
||||
if _in != self.clip_in or _out != self.clip_out:
|
||||
continue
|
||||
|
||||
data_product_name = hero_data["productName"]
|
||||
# add track index in case duplicity of names in hero data
|
||||
if self.product_name in data_product_name:
|
||||
hero_data["productName"] = self.product_name + str(
|
||||
self.track_index)
|
||||
# in case track name and product name is the same then add
|
||||
if self.base_product_name == self.track_name:
|
||||
hero_data["productName"] = self.product_name
|
||||
# assign data to return hierarchy data to tag
|
||||
tag_hierarchy_data = hero_data
|
||||
|
||||
# add data to return data dict
|
||||
self.tag_data.update(tag_hierarchy_data)
|
||||
|
|
@ -859,8 +863,8 @@ class PublishClip:
|
|||
"hierarchy": hierarchy_filled,
|
||||
"parents": self.parents,
|
||||
"hierarchyData": hierarchy_formatting_data,
|
||||
"subset": self.subset,
|
||||
"family": self.subset_family
|
||||
"productName": self.product_name,
|
||||
"productType": self.product_type
|
||||
}
|
||||
|
||||
def _convert_to_entity(self, key):
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ class CreateShotClip(plugin.Creator):
|
|||
"""Publishable clip"""
|
||||
|
||||
label = "Create Publishable Clip"
|
||||
family = "clip"
|
||||
product_type = "clip"
|
||||
icon = "film"
|
||||
defaults = ["Main"]
|
||||
|
||||
gui_tracks = get_video_track_names()
|
||||
gui_name = "OpenPype publish attributes creator"
|
||||
gui_name = "AYON publish attributes creator"
|
||||
gui_info = "Define sequential rename and fill hierarchy data."
|
||||
gui_inputs = {
|
||||
"renameHierarchy": {
|
||||
|
|
@ -133,19 +133,19 @@ class CreateShotClip(plugin.Creator):
|
|||
"target": "ui",
|
||||
"order": 3,
|
||||
"value": {
|
||||
"subsetName": {
|
||||
"productName": {
|
||||
"value": ["<track_name>", "main", "bg", "fg", "bg",
|
||||
"animatic"],
|
||||
"type": "QComboBox",
|
||||
"label": "Subset Name",
|
||||
"label": "Product Name",
|
||||
"target": "ui",
|
||||
"toolTip": "chose subset name pattern, if <track_name> is selected, name of track layer will be used", # noqa
|
||||
"toolTip": "chose product name pattern, if <track_name> is selected, name of track layer will be used", # noqa
|
||||
"order": 0},
|
||||
"subsetFamily": {
|
||||
"productType": {
|
||||
"value": ["plate", "take"],
|
||||
"type": "QComboBox",
|
||||
"label": "Subset Family",
|
||||
"target": "ui", "toolTip": "What use of this subset is for", # noqa
|
||||
"label": "Product type",
|
||||
"target": "ui", "toolTip": "What use of this product is for", # noqa
|
||||
"order": 1},
|
||||
"reviewTrack": {
|
||||
"value": ["< none >"] + gui_tracks,
|
||||
|
|
@ -159,7 +159,7 @@ class CreateShotClip(plugin.Creator):
|
|||
"type": "QCheckBox",
|
||||
"label": "Include audio",
|
||||
"target": "tag",
|
||||
"toolTip": "Process subsets with corresponding audio", # noqa
|
||||
"toolTip": "Process products with corresponding audio", # noqa
|
||||
"order": 3},
|
||||
"sourceResolution": {
|
||||
"value": False,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ from ayon_core.lib.transcoding import (
|
|||
|
||||
|
||||
class LoadClip(plugin.TimelineItemLoader):
|
||||
"""Load a subset to timeline as clip
|
||||
"""Load a product to timeline as clip
|
||||
|
||||
Place clip to timeline on its asset origin timings collected
|
||||
during conforming to project
|
||||
|
|
|
|||
|
|
@ -64,11 +64,11 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
})
|
||||
|
||||
asset = tag_data["folder_path"]
|
||||
subset = tag_data["subset"]
|
||||
product_name = tag_data["productName"]
|
||||
|
||||
data.update({
|
||||
"name": "{}_{}".format(asset, subset),
|
||||
"label": "{} {}".format(asset, subset),
|
||||
"name": "{}_{}".format(asset, product_name),
|
||||
"label": "{} {}".format(asset, product_name),
|
||||
"folderPath": asset,
|
||||
"item": timeline_item,
|
||||
"publish": get_publish_attribute(timeline_item),
|
||||
|
|
@ -128,18 +128,18 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
return
|
||||
|
||||
asset = data["folderPath"]
|
||||
subset = "shotMain"
|
||||
product_name = "shotMain"
|
||||
|
||||
# insert family into families
|
||||
family = "shot"
|
||||
product_type = "shot"
|
||||
|
||||
data.update({
|
||||
"name": "{}_{}".format(asset, subset),
|
||||
"label": "{} {}".format(asset, subset),
|
||||
"subset": subset,
|
||||
"name": "{}_{}".format(asset, product_name),
|
||||
"label": "{} {}".format(asset, product_name),
|
||||
"folderPath": asset,
|
||||
"family": family,
|
||||
"families": [],
|
||||
"productName": product_name,
|
||||
"productType": product_type,
|
||||
"families": [product_type],
|
||||
"publish": get_publish_attribute(timeline_item)
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class PrecollectWorkfile(pyblish.api.ContextPlugin):
|
|||
current_asset_name = get_current_asset_name()
|
||||
asset_name = current_asset_name.split("/")[-1]
|
||||
|
||||
subset = "workfileMain"
|
||||
product_name = "workfileMain"
|
||||
project = rapi.get_current_project()
|
||||
fps = project.GetSetting("timelineFrameRate")
|
||||
video_tracks = rapi.get_video_track_names()
|
||||
|
|
@ -26,12 +26,12 @@ class PrecollectWorkfile(pyblish.api.ContextPlugin):
|
|||
otio_timeline = davinci_export.create_otio_timeline(project)
|
||||
|
||||
instance_data = {
|
||||
"name": "{}_{}".format(asset_name, subset),
|
||||
"label": "{} {}".format(current_asset_name, subset),
|
||||
"name": "{}_{}".format(asset_name, product_name),
|
||||
"label": "{} {}".format(current_asset_name, product_name),
|
||||
"folderPath": current_asset_name,
|
||||
"subset": subset,
|
||||
"productName": product_name,
|
||||
"item": project,
|
||||
"family": "workfile",
|
||||
"productType": "workfile",
|
||||
"families": []
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue