mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #5892 from ynput/feature/OP-7238_Use-folder-path-as-identifier-Resolve-editorial
AYON | Resolve: support for folder path
This commit is contained in:
commit
d7c1abaf7d
4 changed files with 42 additions and 31 deletions
|
|
@ -19,7 +19,7 @@ from .menu import load_stylesheet
|
|||
class CreatorWidget(QtWidgets.QDialog):
|
||||
|
||||
# output items
|
||||
items = dict()
|
||||
items = {}
|
||||
|
||||
def __init__(self, name, info, ui_inputs, parent=None):
|
||||
super(CreatorWidget, self).__init__(parent)
|
||||
|
|
@ -101,7 +101,7 @@ class CreatorWidget(QtWidgets.QDialog):
|
|||
self.close()
|
||||
|
||||
def value(self, data, new_data=None):
|
||||
new_data = new_data or dict()
|
||||
new_data = new_data or {}
|
||||
for k, v in data.items():
|
||||
new_data[k] = {
|
||||
"target": None,
|
||||
|
|
@ -290,7 +290,7 @@ class Spacer(QtWidgets.QWidget):
|
|||
class ClipLoader:
|
||||
|
||||
active_bin = None
|
||||
data = dict()
|
||||
data = {}
|
||||
|
||||
def __init__(self, loader_obj, context, **options):
|
||||
""" Initialize object
|
||||
|
|
@ -588,8 +588,8 @@ class PublishClip:
|
|||
Returns:
|
||||
hiero.core.TrackItem: hiero track item object with openpype tag
|
||||
"""
|
||||
vertical_clip_match = dict()
|
||||
tag_data = dict()
|
||||
vertical_clip_match = {}
|
||||
tag_data = {}
|
||||
types = {
|
||||
"shot": "shot",
|
||||
"folder": "folder",
|
||||
|
|
@ -665,15 +665,23 @@ class PublishClip:
|
|||
new_name = self.tag_data.pop("newClipName")
|
||||
|
||||
if self.rename:
|
||||
self.tag_data["asset"] = new_name
|
||||
self.tag_data["asset_name"] = new_name
|
||||
else:
|
||||
self.tag_data["asset"] = self.ti_name
|
||||
self.tag_data["asset_name"] = self.ti_name
|
||||
|
||||
# AYON unique identifier
|
||||
folder_path = "/{}/{}".format(
|
||||
self.tag_data["hierarchy"],
|
||||
self.tag_data["asset_name"]
|
||||
)
|
||||
self.tag_data["folder_path"] = folder_path
|
||||
|
||||
# create new name for track item
|
||||
if not lib.pype_marker_workflow:
|
||||
# create compound clip workflow
|
||||
lib.create_compound_clip(
|
||||
self.timeline_item_data,
|
||||
self.tag_data["asset"],
|
||||
self.tag_data["asset_name"],
|
||||
self.mp_folder
|
||||
)
|
||||
|
||||
|
|
@ -765,7 +773,7 @@ class PublishClip:
|
|||
# increasing steps by index of rename iteration
|
||||
self.count_steps *= self.rename_index
|
||||
|
||||
hierarchy_formatting_data = dict()
|
||||
hierarchy_formatting_data = {}
|
||||
_data = self.timeline_item_default_data.copy()
|
||||
if self.ui_inputs:
|
||||
# adding tag metadata from ui
|
||||
|
|
@ -854,8 +862,7 @@ class PublishClip:
|
|||
"parents": self.parents,
|
||||
"hierarchyData": hierarchy_formatting_data,
|
||||
"subset": self.subset,
|
||||
"family": self.subset_family,
|
||||
"families": ["clip"]
|
||||
"family": self.subset_family
|
||||
}
|
||||
|
||||
def _convert_to_entity(self, key):
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ class ExtractWorkfile(publish.Extractor):
|
|||
|
||||
resolve_workfile_ext = ".drp"
|
||||
drp_file_name = name + resolve_workfile_ext
|
||||
|
||||
drp_file_path = os.path.normpath(
|
||||
os.path.join(staging_dir, drp_file_name))
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from openpype.hosts.resolve.api.lib import (
|
|||
get_publish_attribute,
|
||||
get_otio_clip_instance_data,
|
||||
)
|
||||
from openpype import AYON_SERVER_ENABLED
|
||||
|
||||
|
||||
class PrecollectInstances(pyblish.api.ContextPlugin):
|
||||
|
|
@ -29,7 +30,7 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
|
||||
for timeline_item_data in selected_timeline_items:
|
||||
|
||||
data = dict()
|
||||
data = {}
|
||||
timeline_item = timeline_item_data["clip"]["item"]
|
||||
|
||||
# get pype tag data
|
||||
|
|
@ -60,24 +61,25 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
if k not in ("id", "applieswhole", "label")
|
||||
})
|
||||
|
||||
asset = tag_data["asset"]
|
||||
if AYON_SERVER_ENABLED:
|
||||
asset = tag_data["folder_path"]
|
||||
else:
|
||||
asset = tag_data["asset_name"]
|
||||
|
||||
subset = tag_data["subset"]
|
||||
|
||||
# insert family into families
|
||||
family = tag_data["family"]
|
||||
families = [str(f) for f in tag_data["families"]]
|
||||
families.insert(0, str(family))
|
||||
|
||||
data.update({
|
||||
"name": "{} {} {}".format(asset, subset, families),
|
||||
"name": "{}_{}".format(asset, subset),
|
||||
"label": "{} {}".format(asset, subset),
|
||||
"asset": asset,
|
||||
"item": timeline_item,
|
||||
"families": families,
|
||||
"publish": get_publish_attribute(timeline_item),
|
||||
"fps": context.data["fps"],
|
||||
"handleStart": handle_start,
|
||||
"handleEnd": handle_end,
|
||||
"newAssetPublishing": True
|
||||
"newAssetPublishing": True,
|
||||
"families": ["clip"],
|
||||
"isEditorial": True
|
||||
})
|
||||
|
||||
# otio clip data
|
||||
|
|
@ -135,7 +137,8 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
family = "shot"
|
||||
|
||||
data.update({
|
||||
"name": "{} {} {}".format(asset, subset, family),
|
||||
"name": "{}_{}".format(asset, subset),
|
||||
"label": "{} {}".format(asset, subset),
|
||||
"subset": subset,
|
||||
"asset": asset,
|
||||
"family": family,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ from pprint import pformat
|
|||
|
||||
from openpype import AYON_SERVER_ENABLED
|
||||
from openpype.pipeline import get_current_asset_name
|
||||
|
||||
from openpype.hosts.resolve import api as rapi
|
||||
from openpype.hosts.resolve.otio import davinci_export
|
||||
|
||||
|
|
@ -14,14 +15,12 @@ class PrecollectWorkfile(pyblish.api.ContextPlugin):
|
|||
order = pyblish.api.CollectorOrder - 0.5
|
||||
|
||||
def process(self, context):
|
||||
current_asset = get_current_asset_name()
|
||||
if AYON_SERVER_ENABLED:
|
||||
# AYON compatibility split name and use last piece
|
||||
asset_name = current_asset.split("/")[-1]
|
||||
else:
|
||||
asset_name = current_asset
|
||||
current_asset_name = asset_name = get_current_asset_name()
|
||||
|
||||
subset = "workfile"
|
||||
if AYON_SERVER_ENABLED:
|
||||
asset_name = current_asset_name.split("/")[-1]
|
||||
|
||||
subset = "workfileMain"
|
||||
project = rapi.get_current_project()
|
||||
fps = project.GetSetting("timelineFrameRate")
|
||||
video_tracks = rapi.get_video_track_names()
|
||||
|
|
@ -31,8 +30,9 @@ class PrecollectWorkfile(pyblish.api.ContextPlugin):
|
|||
|
||||
instance_data = {
|
||||
"name": "{}_{}".format(asset_name, subset),
|
||||
"asset": current_asset,
|
||||
"subset": "{}{}".format(asset_name, subset.capitalize()),
|
||||
"label": "{} {}".format(current_asset_name, subset),
|
||||
"asset": current_asset_name,
|
||||
"subset": subset,
|
||||
"item": project,
|
||||
"family": "workfile",
|
||||
"families": []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue