From a84ac3b2db059e47462f06f831d9821e17979cf8 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 16 Jan 2020 19:24:09 +0100 Subject: [PATCH] fix(global): deadline didnt publish all data to representation --- pype/ftrack/actions/action_test.py | 10 +++--- .../global/publish/collect_filesequences.py | 32 +++++++++++++++++-- pype/plugins/global/publish/extract_burnin.py | 3 +- pype/plugins/global/publish/integrate_new.py | 14 +++++--- 4 files changed, 46 insertions(+), 13 deletions(-) diff --git a/pype/ftrack/actions/action_test.py b/pype/ftrack/actions/action_test.py index 502373e626..a1e633bf1b 100644 --- a/pype/ftrack/actions/action_test.py +++ b/pype/ftrack/actions/action_test.py @@ -9,12 +9,11 @@ import re import ftrack_api from pype.ftrack import BaseAction from avalon import io, inventory, schema - +from pypeapp import Anatomy class TestAction(BaseAction): '''Edit meta data action.''' - ignore_me = True #: Action identifier. identifier = 'test.action' #: Action label. @@ -35,8 +34,11 @@ class TestAction(BaseAction): return True def launch(self, session, entities, event): - self.log.info(event) - + anatomy = Anatomy() + data = { + "version": None + } + print(anatomy.format(data)) return True diff --git a/pype/plugins/global/publish/collect_filesequences.py b/pype/plugins/global/publish/collect_filesequences.py index 9d065946ed..a76c8f3c33 100644 --- a/pype/plugins/global/publish/collect_filesequences.py +++ b/pype/plugins/global/publish/collect_filesequences.py @@ -101,6 +101,7 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin): slate_frame = None families_data = None subset = None + version = None if os.environ.get("PYPE_PUBLISH_PATHS"): paths = os.environ["PYPE_PUBLISH_PATHS"].split(os.pathsep) self.log.info("Collecting paths: {}".format(paths)) @@ -158,6 +159,7 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin): subset = instance.get("subset") families_data = instance.get("families") slate_frame = instance.get("slateFrame") + version = instance.get("version") else: # Search in directory @@ -257,6 +259,20 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin): # if we have subset - add all collections and known # reminder as representations + # take out review family if mov path + # this will make imagesequence none review + frame_start = data.get("frameStart") + frame_end = data.get("frameEnd") + + if baked_mov_path: + self.log.info( + "Baked mov is available {}".format( + baked_mov_path)) + families.append("review") + + if "slate" in families: + frame_start -= 1 + self.log.info( "Adding representations to subset {}".format( data.get("subset"))) @@ -273,12 +289,15 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin): "asset": data.get( "asset", api.Session["AVALON_ASSET"]), "stagingDir": root, - "frameStart": data.get("frameStart"), - "frameEnd": data.get("frameEnd"), + "frameStart": frame_start, + "frameEnd": frame_end, "fps": fps, "source": data.get("source", ""), "pixelAspect": pixel_aspect, - "slateFrame": slate_frame + "resolutionWidth": resolution_width, + "resolutionHeight": resolution_height, + "slateFrame": slate_frame, + "version": version } ) @@ -294,6 +313,8 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin): "name": ext, "ext": "{}".format(ext), "files": list(collection), + "frameStart": frame_start, + "frameEnd": frame_end, "stagingDir": root, "anatomy_template": "render", "fps": fps, @@ -307,11 +328,16 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin): # add only known types to representation if rem.split(".")[-1] in ['mov', 'jpg', 'mp4']: self.log.info(" . {}".format(rem)) + + if "slate" in instance.data["families"]: + frame_start += 1 + representation = { "name": rem.split(".")[-1], "ext": "{}".format(rem.split(".")[-1]), "files": rem, "stagingDir": root, + "frameStart": frame_start, "anatomy_template": "render", "fps": fps, "tags": ["review"], diff --git a/pype/plugins/global/publish/extract_burnin.py b/pype/plugins/global/publish/extract_burnin.py index ecc17b669e..99bf8a4672 100644 --- a/pype/plugins/global/publish/extract_burnin.py +++ b/pype/plugins/global/publish/extract_burnin.py @@ -25,7 +25,8 @@ class ExtractBurnin(pype.api.Extractor): if "representations" not in instance.data: raise RuntimeError("Burnin needs already created mov to work on.") - version = instance.context.data.get('version') + version = instance.context.data.get( + 'version', instance.data.get('version')) frame_start = int(instance.data.get("frameStart") or 0) frame_end = int(instance.data.get("frameEnd") or 1) duration = frame_end - frame_start + 1 diff --git a/pype/plugins/global/publish/integrate_new.py b/pype/plugins/global/publish/integrate_new.py index 8751431223..f1a125c4b2 100644 --- a/pype/plugins/global/publish/integrate_new.py +++ b/pype/plugins/global/publish/integrate_new.py @@ -316,7 +316,7 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): # exception for slate workflow if "slate" in instance.data["families"]: index_frame_start -= 1 - + dst_padding_exp = src_padding_exp dst_start_frame = None for i in src_collection.indexes: @@ -408,6 +408,9 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): } } + if repre.get("outputName"): + representation["context"]["output"] = repre['outputName'] + if sequence_repre and repre.get("frameStart"): representation['context']['frame'] = src_padding_exp % int(repre.get("frameStart")) @@ -455,11 +458,11 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): self.hardlink_file(src, dest) def unc_convert(self, path): + self.log.debug("> __ path: `{}`".format(path)) drive, _path = os.path.splitdrive(path) - unc = Path(drive).resolve() - path = str(unc) + _path + self.log.debug("> __ drive, _path: `{}`, `{}`".format(drive, _path)) - if not os.path.exists(str(unc)): + if not os.path.exists(drive + "/"): self.log.info("Converting to unc from environments ..") path_replace = os.getenv("PYPE_STUDIO_PROJECTS_PATH") @@ -611,7 +614,8 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): "source": source, "comment": context.data.get("comment"), "machine": context.data.get("machine"), - "fps": context.data.get("fps")} + "fps": context.data.get( + "fps", instance.data.get("fps"))} # Include optional data if present in optionals = [