mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Merge branch 'feature/nuke-slate-prerender' into master-testing-local
# Conflicts: # pype/plugins/global/publish/collect_filesequences.py # pype/plugins/global/publish/integrate_new.py
This commit is contained in:
commit
13f08c7f1f
8 changed files with 77 additions and 39 deletions
|
|
@ -1460,14 +1460,13 @@ class ExporterReviewMov(ExporterReview):
|
|||
self.log.info("Rendered...")
|
||||
|
||||
def save_file(self):
|
||||
import shutil
|
||||
with anlib.maintained_selection():
|
||||
self.log.info("Saving nodes as file... ")
|
||||
# select temp nodes
|
||||
anlib.select_nodes(self._temp_nodes)
|
||||
# create nk path
|
||||
path = os.path.splitext(self.path)[0] + ".nk"
|
||||
# save file to the path
|
||||
nuke.nodeCopy(path)
|
||||
shutil.copyfile(self.instance.context.data["currentFile"], path)
|
||||
|
||||
self.log.info("Nodes exported...")
|
||||
return path
|
||||
|
|
@ -1522,6 +1521,7 @@ class ExporterReviewMov(ExporterReview):
|
|||
|
||||
# ---------- render or save to nk
|
||||
if farm:
|
||||
nuke.scriptSave()
|
||||
path_nk = self.save_file()
|
||||
self.data.update({
|
||||
"bakeScriptPath": path_nk,
|
||||
|
|
@ -1540,7 +1540,7 @@ class ExporterReviewMov(ExporterReview):
|
|||
|
||||
# ---------- Clean up
|
||||
self.clean_nodes()
|
||||
|
||||
nuke.scriptSave()
|
||||
return self.data
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
|
|||
resolution_height = 1080
|
||||
lut_path = None
|
||||
slate_frame = None
|
||||
families_data = None
|
||||
subset = None
|
||||
if os.environ.get("PYPE_PUBLISH_PATHS"):
|
||||
paths = os.environ["PYPE_PUBLISH_PATHS"].split(os.pathsep)
|
||||
|
|
@ -157,6 +158,7 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
|
|||
lut_path = instance.get("lutPath", None)
|
||||
baked_mov_path = instance.get("bakeRenderPath")
|
||||
subset = instance.get("subset")
|
||||
families_data = instance.get("families")
|
||||
slate_frame = instance.get("slateFrame")
|
||||
|
||||
else:
|
||||
|
|
@ -197,6 +199,8 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
|
|||
families.append("ftrack")
|
||||
if "write" in instance_family:
|
||||
families.append("write")
|
||||
if families_data and "slate" in families_data:
|
||||
families.append("slate")
|
||||
|
||||
if data.get("attachTo"):
|
||||
# we need to attach found collections to existing
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
dst_head,
|
||||
dst_start_frame,
|
||||
dst_tail).replace("..", ".")
|
||||
repre['published_path'] = dst
|
||||
repre['published_path'] = self.unc_convert(dst)
|
||||
|
||||
else:
|
||||
# Single file
|
||||
|
|
@ -386,7 +386,7 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
|
||||
instance.data["transfers"].append([src, dst])
|
||||
|
||||
repre['published_path'] = dst
|
||||
repre['published_path'] = self.unc_convert(dst)
|
||||
self.log.debug("__ dst: {}".format(dst))
|
||||
|
||||
representation = {
|
||||
|
|
@ -460,6 +460,27 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
self.log.debug("Hardlinking file .. {} -> {}".format(src, dest))
|
||||
self.hardlink_file(src, dest)
|
||||
|
||||
def unc_convert(self, path):
|
||||
self.log.debug("_ path .. `{}`".format(path))
|
||||
drive, _path = os.path.splitdrive(path)
|
||||
self.log.debug("_ drive, _path .. `{}`, `{}`".format(drive, _path))
|
||||
unc = Path(drive).resolve()
|
||||
self.log.debug("_ unc.resolved .. `{}`".format(unc))
|
||||
path = str(unc) + _path
|
||||
self.log.debug("_ path.resolved .. `{}`".format(path))
|
||||
|
||||
if not os.path.exists(str(unc)):
|
||||
self.log.info("_ converting to unc from environments ..")
|
||||
path_replace = os.getenv("PYPE_STUDIO_PROJECTS_PATH")
|
||||
path_mount = os.getenv("PYPE_STUDIO_PROJECTS_MOUNT")
|
||||
self.log.debug("_ path_replace .. `{}`".format(path_replace))
|
||||
self.log.debug("_ path_mount .. `{}`".format(path_mount))
|
||||
if "/" in path_mount:
|
||||
path = path.replace(path_mount[0:-1], path_replace)
|
||||
else:
|
||||
path = path.replace(path_mount, path_replace)
|
||||
return path
|
||||
|
||||
def copy_file(self, src, dst):
|
||||
""" Copy given source to destination
|
||||
|
||||
|
|
@ -469,11 +490,8 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
Returns:
|
||||
None
|
||||
"""
|
||||
|
||||
src = str(Path(src).resolve())
|
||||
drive, _path = os.path.splitdrive(dst)
|
||||
unc = Path(drive).resolve()
|
||||
dst = str(unc) + _path
|
||||
src = self.unc_convert(src)
|
||||
dst = self.unc_convert(dst)
|
||||
|
||||
self.log.debug("Copying file .. {} -> {}".format(src, dst))
|
||||
dirname = os.path.dirname(dst)
|
||||
|
|
@ -495,10 +513,8 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
def hardlink_file(self, src, dst):
|
||||
dirname = os.path.dirname(dst)
|
||||
|
||||
src = str(Path(src).resolve())
|
||||
drive, _path = os.path.splitdrive(dst)
|
||||
unc = Path(drive).resolve()
|
||||
dst = str(unc) + _path
|
||||
src = self.unc_convert(src)
|
||||
dst = self.unc_convert(dst)
|
||||
|
||||
try:
|
||||
os.makedirs(dirname)
|
||||
|
|
|
|||
|
|
@ -202,19 +202,27 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
|||
# job so they use the same environment
|
||||
|
||||
environment = job["Props"].get("Env", {})
|
||||
|
||||
environment = dict(
|
||||
{key: os.environ[key] for key in self.enviro_filter
|
||||
if key in environment}, **api.Session)
|
||||
|
||||
self.log.debug("___> enviro: {}".format(environment))
|
||||
for _key in os.environ:
|
||||
if _key.lower().startswith('pype_'):
|
||||
environment[_key] = os.environ[_key]
|
||||
|
||||
i = 0
|
||||
for index, key in enumerate(environment):
|
||||
self.log.info("KEY: {}".format(key))
|
||||
self.log.info("FILTER: {}".format(self.enviro_filter))
|
||||
|
||||
if key.upper() in self.enviro_filter:
|
||||
payload["JobInfo"].update({
|
||||
"EnvironmentKeyValue%d" % i: "{key}={value}".format(
|
||||
key=key,
|
||||
value=environment[key]
|
||||
)
|
||||
})
|
||||
i += 1
|
||||
payload["JobInfo"].update({
|
||||
"EnvironmentKeyValue%d" % i: "{key}={value}".format(
|
||||
key=key,
|
||||
value=environment[key]
|
||||
)
|
||||
})
|
||||
i += 1
|
||||
|
||||
# Avoid copied pools and remove secondary pool
|
||||
payload["JobInfo"]["Pool"] = "none"
|
||||
|
|
|
|||
|
|
@ -16,23 +16,26 @@ class ExtractReviewDataMov(pype.api.Extractor):
|
|||
order = pyblish.api.ExtractorOrder + 0.01
|
||||
label = "Extract Review Data Mov"
|
||||
|
||||
families = ["review"]
|
||||
families = ["review", "render", "render.local"]
|
||||
hosts = ["nuke"]
|
||||
|
||||
def process(self, instance):
|
||||
families = instance.data["families"]
|
||||
|
||||
self.log.info("Creating staging dir...")
|
||||
self.log.debug(
|
||||
"__ representations: `{}`".format(
|
||||
instance.data["representations"]))
|
||||
if "representations" in instance.data:
|
||||
staging_dir = instance.data[
|
||||
"representations"][0]["stagingDir"].replace("\\", "/")
|
||||
instance.data["stagingDir"] = staging_dir
|
||||
instance.data["representations"][0]["tags"] = []
|
||||
else:
|
||||
instance.data["representations"] = []
|
||||
# get output path
|
||||
render_path = instance.data['path']
|
||||
staging_dir = os.path.normpath(os.path.dirname(render_path))
|
||||
instance.data["stagingDir"] = staging_dir
|
||||
if instance.data["representations"] == []:
|
||||
render_path = instance.data['path']
|
||||
staging_dir = os.path.normpath(os.path.dirname(render_path))
|
||||
instance.data["stagingDir"] = staging_dir
|
||||
else:
|
||||
staging_dir = instance.data[
|
||||
"representations"][0]["stagingDir"].replace("\\", "/")
|
||||
instance.data["representations"][0]["tags"] = []
|
||||
instance.data["stagingDir"] = staging_dir
|
||||
|
||||
self.log.info(
|
||||
"StagingDir `{0}`...".format(instance.data["stagingDir"]))
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class ExtractSlateFrame(pype.api.Extractor):
|
|||
|
||||
# fill slate node with comments
|
||||
self.add_comment_slate_node(instance)
|
||||
|
||||
|
||||
# Render frames
|
||||
nuke.execute(write_node.name(), int(first_frame), int(last_frame))
|
||||
|
||||
|
|
@ -149,3 +149,4 @@ class ExtractSlateFrame(pype.api.Extractor):
|
|||
node["f_submitting_for"].setValue(intent)
|
||||
except NameError:
|
||||
return
|
||||
instance.data.pop("slateNode")
|
||||
|
|
|
|||
|
|
@ -30,9 +30,15 @@ class ExtractThumbnail(pype.api.Extractor):
|
|||
def render_thumbnail(self, instance):
|
||||
node = instance[0] # group node
|
||||
self.log.info("Creating staging dir...")
|
||||
self.log.debug(
|
||||
"_ representations `{0}`".format(instance.data["representations"]))
|
||||
if "representations" in instance.data:
|
||||
staging_dir = instance.data[
|
||||
"representations"][0]["stagingDir"].replace("\\", "/")
|
||||
try:
|
||||
staging_dir = instance.data[
|
||||
"representations"][0]["stagingDir"].replace("\\", "/")
|
||||
except IndexError:
|
||||
path = instance.data["path"]
|
||||
staging_dir = os.path.dirname(path)
|
||||
instance.data["stagingDir"] = staging_dir
|
||||
else:
|
||||
instance.data["representations"] = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue