fix(global): deadline didnt publish all data to representation

This commit is contained in:
Jakub Jezek 2020-01-16 19:24:09 +01:00
parent dad87fa395
commit a84ac3b2db
4 changed files with 46 additions and 13 deletions

View file

@ -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"],

View file

@ -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

View file

@ -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 = [