mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
modified some parts of hiero to follow new 'asset' handling
This commit is contained in:
parent
8360c321bd
commit
5ada46f2a0
5 changed files with 28 additions and 21 deletions
|
|
@ -11,7 +11,6 @@ import qargparse
|
|||
from openpype.settings import get_current_project_settings
|
||||
from openpype.lib import Logger
|
||||
from openpype.pipeline import LoaderPlugin, LegacyCreator
|
||||
from openpype.pipeline.context_tools import get_current_project_asset
|
||||
from openpype.pipeline.load import get_representation_path_from_context
|
||||
from . import lib
|
||||
|
||||
|
|
@ -494,9 +493,8 @@ class ClipLoader:
|
|||
joint `data` key with asset.data dict into the representation
|
||||
|
||||
"""
|
||||
asset_name = self.context["representation"]["context"]["asset"]
|
||||
asset_doc = get_current_project_asset(asset_name)
|
||||
log.debug("__ asset_doc: {}".format(pformat(asset_doc)))
|
||||
|
||||
asset_doc = self.context["asset"]
|
||||
self.data["assetData"] = asset_doc["data"]
|
||||
|
||||
def _make_track_item(self, source_bin_item, audio=False):
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import json
|
|||
|
||||
import pyblish.api
|
||||
|
||||
from openpype.client import get_asset_name_identifier
|
||||
|
||||
|
||||
class CollectFrameTagInstances(pyblish.api.ContextPlugin):
|
||||
"""Collect frames from tags.
|
||||
|
|
@ -99,6 +101,9 @@ class CollectFrameTagInstances(pyblish.api.ContextPlugin):
|
|||
|
||||
# first collect all available subset tag frames
|
||||
subset_data = {}
|
||||
context_asset_doc = context.data["assetEntity"]
|
||||
context_asset_name = get_asset_name_identifier(context_asset_doc)
|
||||
|
||||
for tag_data in sequence_tags:
|
||||
frame = int(tag_data["start"])
|
||||
|
||||
|
|
@ -115,7 +120,7 @@ class CollectFrameTagInstances(pyblish.api.ContextPlugin):
|
|||
subset_data[subset] = {
|
||||
"frames": [frame],
|
||||
"format": tag_data["format"],
|
||||
"asset": context.data["assetEntity"]["name"]
|
||||
"asset": context_asset_name
|
||||
}
|
||||
return subset_data
|
||||
|
||||
|
|
|
|||
|
|
@ -178,7 +178,6 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
def create_shot_instance(self, context, **data):
|
||||
master_layer = data.get("heroTrack")
|
||||
hierarchy_data = data.get("hierarchyData")
|
||||
asset = data.get("asset")
|
||||
item = data.get("item")
|
||||
clip_name = item.name()
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ from qtpy.QtGui import QPixmap
|
|||
|
||||
import hiero.ui
|
||||
|
||||
from openpype import AYON_SERVER_ENABLED
|
||||
from openpype.hosts.hiero.api.otio import hiero_export
|
||||
|
||||
|
||||
|
|
@ -17,9 +18,10 @@ class PrecollectWorkfile(pyblish.api.ContextPlugin):
|
|||
order = pyblish.api.CollectorOrder - 0.491
|
||||
|
||||
def process(self, context):
|
||||
asset_name = context.data["asset"]
|
||||
if AYON_SERVER_ENABLED:
|
||||
asset_name = asset_name.split("/")[-1]
|
||||
|
||||
asset = context.data["asset"]
|
||||
subset = "workfile"
|
||||
active_timeline = hiero.ui.activeSequence()
|
||||
project = active_timeline.project()
|
||||
fps = active_timeline.framerate().toFloat()
|
||||
|
|
@ -59,13 +61,14 @@ class PrecollectWorkfile(pyblish.api.ContextPlugin):
|
|||
'files': base_name,
|
||||
"stagingDir": staging_dir,
|
||||
}
|
||||
|
||||
family = "workfile"
|
||||
instance_data = {
|
||||
"name": "{}_{}".format(asset, subset),
|
||||
"asset": asset,
|
||||
"subset": "{}{}".format(asset, subset.capitalize()),
|
||||
"name": "{}_{}".format(asset_name, family),
|
||||
"asset": context.data["asset"],
|
||||
# TODO use 'get_subset_name'
|
||||
"subset": "{}{}".format(asset_name, family.capitalize()),
|
||||
"item": project,
|
||||
"family": "workfile",
|
||||
"family": family,
|
||||
"families": [],
|
||||
"representations": [workfile_representation, thumb_representation]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
from pyblish import api
|
||||
from openpype.client import get_assets
|
||||
|
||||
from openpype.client import get_assets, get_asset_name_identifier
|
||||
|
||||
|
||||
class CollectAssetBuilds(api.ContextPlugin):
|
||||
|
|
@ -19,10 +20,13 @@ class CollectAssetBuilds(api.ContextPlugin):
|
|||
def process(self, context):
|
||||
project_name = context.data["projectName"]
|
||||
asset_builds = {}
|
||||
for asset in get_assets(project_name):
|
||||
if asset["data"]["entityType"] == "AssetBuild":
|
||||
self.log.debug("Found \"{}\" in database.".format(asset))
|
||||
asset_builds[asset["name"]] = asset
|
||||
for asset_doc in get_assets(project_name):
|
||||
if asset_doc["data"].get("entityType") != "AssetBuild":
|
||||
continue
|
||||
|
||||
asset_name = get_asset_name_identifier(asset_doc)
|
||||
self.log.debug("Found \"{}\" in database.".format(asset_doc))
|
||||
asset_builds[asset_name] = asset_doc
|
||||
|
||||
for instance in context:
|
||||
if instance.data["family"] != "clip":
|
||||
|
|
@ -50,9 +54,7 @@ class CollectAssetBuilds(api.ContextPlugin):
|
|||
# Collect asset builds.
|
||||
data = {"assetbuilds": []}
|
||||
for name in asset_names:
|
||||
data["assetbuilds"].append(
|
||||
asset_builds[name]
|
||||
)
|
||||
data["assetbuilds"].append(asset_builds[name])
|
||||
self.log.debug(
|
||||
"Found asset builds: {}".format(data["assetbuilds"])
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue