mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
support for yeti caches
This commit is contained in:
parent
9853e258e4
commit
3a1afe5d1e
3 changed files with 32 additions and 14 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import os
|
||||
import logging
|
||||
import shutil
|
||||
import clique
|
||||
|
||||
import errno
|
||||
import pyblish.api
|
||||
|
|
@ -25,9 +24,7 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
|
|||
|
||||
label = "Integrate Asset"
|
||||
order = pyblish.api.IntegratorOrder
|
||||
families = ["assembly",
|
||||
"yetiRig",
|
||||
"yeticache"]
|
||||
families = ["assembly"]
|
||||
exclude_families = ["clip"]
|
||||
|
||||
def process(self, instance):
|
||||
|
|
@ -41,7 +38,6 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
|
|||
if instance.data.get('transfer', True):
|
||||
self.integrate(instance)
|
||||
|
||||
|
||||
def register(self, instance):
|
||||
# Required environment variables
|
||||
PROJECT = api.Session["AVALON_PROJECT"]
|
||||
|
|
@ -158,7 +154,7 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
|
|||
"version": int(version["name"]),
|
||||
"hierarchy": hierarchy}
|
||||
|
||||
template_publish = project["config"]["template"]["publish"]
|
||||
# template_publish = project["config"]["template"]["publish"]
|
||||
anatomy = instance.context.data['anatomy']
|
||||
|
||||
# Find the representations to transfer amongst the files
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ from os.path import getsize
|
|||
import logging
|
||||
import speedcopy
|
||||
import clique
|
||||
import traceback
|
||||
import errno
|
||||
import pyblish.api
|
||||
from avalon import api, io
|
||||
|
|
@ -64,7 +63,9 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
"plate",
|
||||
"look",
|
||||
"lut",
|
||||
"audio"
|
||||
"audio",
|
||||
"yetiRig",
|
||||
"yeticache"
|
||||
]
|
||||
exclude_families = ["clip"]
|
||||
|
||||
|
|
@ -110,7 +111,7 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
# extracted_traceback[1], result["error"]
|
||||
# )
|
||||
# )
|
||||
# assert all(result["success"] for result in context.data["results"]), (
|
||||
# assert all(result["success"] for result in context.data["results"]),(
|
||||
# "Atomicity not held, aborting.")
|
||||
|
||||
# Assemble
|
||||
|
|
@ -328,7 +329,9 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
self.log.debug("source: {}".format(src))
|
||||
instance.data["transfers"].append([src, dst])
|
||||
|
||||
repre['published_path'] = "{0}{1}{2}".format(dst_head, dst_padding_exp, dst_tail)
|
||||
repre['published_path'] = "{0}{1}{2}".format(dst_head,
|
||||
dst_padding_exp,
|
||||
dst_tail)
|
||||
# for imagesequence version data
|
||||
hashes = '#' * len(dst_padding)
|
||||
dst = os.path.normpath("{0}{1}{2}".format(
|
||||
|
|
|
|||
|
|
@ -63,10 +63,29 @@ class ExtractYetiCache(pype.api.Extractor):
|
|||
with open(data_file, "w") as fp:
|
||||
json.dump(settings, fp, ensure_ascii=False)
|
||||
|
||||
# Ensure files can be stored
|
||||
if "files" not in instance.data:
|
||||
instance.data["files"] = list()
|
||||
# build representations
|
||||
if "representations" not in instance.data:
|
||||
instance.data["representations"] = []
|
||||
|
||||
instance.data["files"].extend([cache_files, "yeti.fursettings"])
|
||||
self.log.info("cache files: {}".format(cache_files[0]))
|
||||
instance.data["representations"].append(
|
||||
{
|
||||
'name': cache_files[0].split(".")[0],
|
||||
'ext': 'fur',
|
||||
'files': cache_files,
|
||||
'stagingDir': dirname,
|
||||
'anatomy_template': 'publish'
|
||||
}
|
||||
)
|
||||
|
||||
instance.data["representations"].append(
|
||||
{
|
||||
'name': os.path.basename(data_file),
|
||||
'ext': 'fursettings',
|
||||
'files': os.path.basename(data_file),
|
||||
'stagingDir': dirname,
|
||||
'anatomy_template': 'publish'
|
||||
}
|
||||
)
|
||||
|
||||
self.log.info("Extracted {} to {}".format(instance, dirname))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue