From 562e59880a118410604b3b4e160d1d9d8999c30f Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 13 Mar 2020 23:49:03 +0100 Subject: [PATCH 01/12] use frameEndHandles for review publish --- pype/plugins/nuke/publish/collect_writes.py | 8 ++++---- pype/plugins/nuke/publish/extract_render_local.py | 4 ++-- pype/plugins/nuke/publish/validate_rendered_frames.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pype/plugins/nuke/publish/collect_writes.py b/pype/plugins/nuke/publish/collect_writes.py index 993b8574f5..0dc7c81fae 100644 --- a/pype/plugins/nuke/publish/collect_writes.py +++ b/pype/plugins/nuke/publish/collect_writes.py @@ -36,7 +36,6 @@ class CollectNukeWrites(pyblish.api.InstancePlugin): output_type = "mov" # Get frame range - handles = instance.context.data['handles'] handle_start = instance.context.data["handleStart"] handle_end = instance.context.data["handleEnd"] first_frame = int(nuke.root()["first_frame"].getValue()) @@ -46,7 +45,6 @@ class CollectNukeWrites(pyblish.api.InstancePlugin): ) if node["use_limit"].getValue(): - handles = 0 first_frame = int(node["first"].getValue()) last_frame = int(node["last"].getValue()) @@ -134,8 +132,10 @@ class CollectNukeWrites(pyblish.api.InstancePlugin): "label": label, "handleStart": handle_start, "handleEnd": handle_end, - "frameStart": first_frame, - "frameEnd": last_frame, + "frameStart": first_frame + handle_start, + "frameEnd": last_frame - handle_end, + "frameStartHandle": first_frame, + "frameEndHandle": last_frame, "outputType": output_type, "family": "write", "families": families, diff --git a/pype/plugins/nuke/publish/extract_render_local.py b/pype/plugins/nuke/publish/extract_render_local.py index 9b8baa468b..5467d239c2 100644 --- a/pype/plugins/nuke/publish/extract_render_local.py +++ b/pype/plugins/nuke/publish/extract_render_local.py @@ -27,13 +27,13 @@ class NukeRenderLocal(pype.api.Extractor): self.log.debug("instance collected: {}".format(instance.data)) - first_frame = instance.data.get("frameStart", None) + first_frame = instance.data.get("frameStartHandle", None) # exception for slate workflow if "slate" in instance.data["families"]: first_frame -= 1 - last_frame = instance.data.get("frameEnd", None) + last_frame = instance.data.get("frameEndHandle", None) node_subset_name = instance.data.get("name", None) self.log.info("Starting render") diff --git a/pype/plugins/nuke/publish/validate_rendered_frames.py b/pype/plugins/nuke/publish/validate_rendered_frames.py index 8a8bf3cc5e..6e9b91dd72 100644 --- a/pype/plugins/nuke/publish/validate_rendered_frames.py +++ b/pype/plugins/nuke/publish/validate_rendered_frames.py @@ -51,7 +51,7 @@ class ValidateRenderedFrames(pyblish.api.InstancePlugin): collection = collections[0] frame_length = int( - instance.data["frameEnd"] - instance.data["frameStart"] + 1 + instance.data["frameEndHandle"] - instance.data["frameStartHandle"] + 1 ) if frame_length != 1: From 9265f20cc7cd440746543e7d6bc8e299045a4725 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 13 Mar 2020 23:50:45 +0100 Subject: [PATCH 02/12] use frame range with handles in global review plugins --- pype/plugins/global/publish/extract_burnin.py | 19 ++++++----- pype/plugins/global/publish/extract_review.py | 33 ++++++++++--------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/pype/plugins/global/publish/extract_burnin.py b/pype/plugins/global/publish/extract_burnin.py index faecbb47a7..1251e5c02f 100644 --- a/pype/plugins/global/publish/extract_burnin.py +++ b/pype/plugins/global/publish/extract_burnin.py @@ -35,17 +35,20 @@ class ExtractBurnin(pype.api.Extractor): context_data.get("handleStart")) handle_end = instance.data.get("handleEnd", context_data.get("handleEnd")) - duration = frame_end - frame_start + 1 + + frame_start_handle = frame_start - handle_start + frame_end_handle = frame_end + handle_end + duration = frame_end_handle - frame_start_handle + 1 prep_data = copy.deepcopy(instance.data["anatomyData"]) if "slate.farm" in instance.data["families"]: - frame_start += 1 + frame_start_handle += 1 duration -= 1 prep_data.update({ - "frame_start": frame_start, - "frame_end": frame_end, + "frame_start": frame_start_handle, + "frame_end": frame_end_handle, "duration": duration, "version": int(version), "comment": instance.context.data.get("comment", ""), @@ -99,13 +102,13 @@ class ExtractBurnin(pype.api.Extractor): _prep_data["anatomy"] = filled_anatomy.get_solved() # copy frame range variables - frame_start_cp = frame_start - frame_end_cp = frame_end + frame_start_cp = frame_start_handle + frame_end_cp = frame_end_handle duration_cp = duration if no_handles: - frame_start_cp = frame_start + handle_start - frame_end_cp = frame_end - handle_end + frame_start_cp = frame_start + frame_end_cp = frame_end duration_cp = frame_end_cp - frame_start_cp + 1 _prep_data.update({ "frame_start": frame_start_cp, diff --git a/pype/plugins/global/publish/extract_review.py b/pype/plugins/global/publish/extract_review.py index 23e582edd2..abe3d36758 100644 --- a/pype/plugins/global/publish/extract_review.py +++ b/pype/plugins/global/publish/extract_review.py @@ -166,30 +166,33 @@ class ExtractReview(pyblish.api.InstancePlugin): # necessary input data # adds start arg only if image sequence + + frame_start_handle = frame_start - handle_start + frame_end_handle = frame_end + handle_end if isinstance(repre["files"], list): - if frame_start != repre.get("detectedStart", frame_start): - frame_start = repre.get("detectedStart") + if frame_start_handle != repre.get("detectedStart", frame_start_handle): + frame_start_handle = repre.get("detectedStart") # exclude handle if no handles defined if no_handles: - frame_start_no_handles = frame_start + handle_start - frame_end_no_handles = frame_end - handle_end + frame_start_handle = frame_start + frame_end_handle = frame_end input_args.append( "-start_number {0} -framerate {1}".format( - frame_start, fps)) + frame_start_handle, fps)) else: if no_handles: start_sec = float(handle_start) / fps input_args.append("-ss {:0.2f}".format(start_sec)) - frame_start_no_handles = frame_start + handle_start - frame_end_no_handles = frame_end - handle_end + frame_start_handle = frame_start + frame_end_handle = frame_end input_args.append("-i {}".format(full_input_path)) for audio in instance.data.get("audio", []): offset_frames = ( - instance.data.get("startFrameReview") - + instance.data.get("frameStartFtrack") - audio["offset"] ) offset_seconds = offset_frames / fps @@ -264,10 +267,8 @@ class ExtractReview(pyblish.api.InstancePlugin): output_args.append("-shortest") if no_handles: - duration_sec = float( - (frame_end - ( - frame_start + handle_start - ) + 1) - handle_end) / fps + duration_sec = float(frame_end_handle - frame_start_handle + 1) / fps + output_args.append("-t {:0.2f}".format(duration_sec)) # output filename @@ -383,7 +384,9 @@ class ExtractReview(pyblish.api.InstancePlugin): "codec": codec_args, "_profile": profile, "resolutionHeight": resolution_height, - "resolutionWidth": resolution_width + "resolutionWidth": resolution_width, + "frameStartFtrack": frame_start_handle, + "frameEndFtrack": frame_end_handle }) if is_sequence: repre_new.update({ @@ -393,8 +396,8 @@ class ExtractReview(pyblish.api.InstancePlugin): if no_handles: repre_new.update({ "outputName": name + "_noHandles", - "startFrameReview": frame_start_no_handles, - "endFrameReview": frame_end_no_handles + "frameStartFtrack": frame_start, + "frameEndFtrack": frame_end }) if repre_new.get('preview'): repre_new.pop("preview") From 0c296ae14db22f7b961b7c8784cafee2ac2d254e Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 13 Mar 2020 23:51:44 +0100 Subject: [PATCH 03/12] rename startFrameReview to frameStartFtrack --- pype/plugins/ftrack/publish/integrate_ftrack_instances.py | 4 ++-- pype/plugins/maya/publish/extract_quicktime.py | 8 ++------ .../plugins/standalonepublisher/publish/extract_review.py | 4 ++-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/pype/plugins/ftrack/publish/integrate_ftrack_instances.py b/pype/plugins/ftrack/publish/integrate_ftrack_instances.py index 78583b0a2f..ec57f46d61 100644 --- a/pype/plugins/ftrack/publish/integrate_ftrack_instances.py +++ b/pype/plugins/ftrack/publish/integrate_ftrack_instances.py @@ -73,9 +73,9 @@ class IntegrateFtrackInstance(pyblish.api.InstancePlugin): ''' start_frame = 0 end_frame = 1 - if 'endFrameReview' in comp and 'startFrameReview' in comp: + if 'frameEndFtrack' in comp and 'frameStartFtrack' in comp: end_frame += ( - comp['endFrameReview'] - comp['startFrameReview'] + comp['frameEndFtrack'] - comp['frameStartFtrack'] ) else: end_frame += ( diff --git a/pype/plugins/maya/publish/extract_quicktime.py b/pype/plugins/maya/publish/extract_quicktime.py index 94b5a716a2..29d6b78051 100644 --- a/pype/plugins/maya/publish/extract_quicktime.py +++ b/pype/plugins/maya/publish/extract_quicktime.py @@ -33,17 +33,13 @@ class ExtractQuicktime(pype.api.Extractor): # if start and end frames cannot be determined, get them # from Maya timeline - start = instance.data.get("startFrameReview") - end = instance.data.get("endFrameReview") + start = instance.data.get("frameStartFtrack") + end = instance.data.get("frameEndFtrack") if start is None: start = cmds.playbackOptions(query=True, animationStartTime=True) if end is None: end = cmds.playbackOptions(query=True, animationEndTime=True) self.log.info("start: {}, end: {}".format(start, end)) - handles = instance.data.get("handles", 0) - if handles: - start -= handles - end += handles # get cameras camera = instance.data['review_camera'] diff --git a/pype/plugins/standalonepublisher/publish/extract_review.py b/pype/plugins/standalonepublisher/publish/extract_review.py index 66cdcdf4df..36793d4c62 100644 --- a/pype/plugins/standalonepublisher/publish/extract_review.py +++ b/pype/plugins/standalonepublisher/publish/extract_review.py @@ -170,8 +170,8 @@ class ExtractReviewSP(pyblish.api.InstancePlugin): "stagingDir": out_stagigng_dir, "tags": new_tags, "outputName": name, - "startFrameReview": 1, - "endFrameReview": video_len + "frameStartFtrack": 1, + "frameEndFtrack": video_len }) # cleanup thumbnail from new repre if repre_new.get("thumbnail"): From fb915f2366dd00a10443411af64122ae03bb3042 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 13 Mar 2020 23:52:17 +0100 Subject: [PATCH 04/12] use frame range with handles in maya --- pype/plugins/maya/publish/collect_instances.py | 13 +++++++++---- pype/plugins/maya/publish/collect_render.py | 14 ++++++++------ pype/plugins/maya/publish/collect_review.py | 10 ++++++---- pype/plugins/maya/publish/submit_maya_deadline.py | 6 +++--- 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/pype/plugins/maya/publish/collect_instances.py b/pype/plugins/maya/publish/collect_instances.py index 39d7bcd86d..5af717ba4d 100644 --- a/pype/plugins/maya/publish/collect_instances.py +++ b/pype/plugins/maya/publish/collect_instances.py @@ -103,16 +103,22 @@ class CollectInstances(pyblish.api.ContextPlugin): # Store the exact members of the object set instance.data["setMembers"] = members - # Define nice label name = cmds.ls(objset, long=False)[0] # use short name label = "{0} ({1})".format(name, data["asset"]) + if "handles" in data: + data["handleStart"] = data["handles"] + data["handleEnd"] = data["handles"] + # Append start frame and end frame to label if present if "frameStart" and "frameEnd" in data: - label += " [{0}-{1}]".format(int(data["frameStart"]), - int(data["frameEnd"])) + data["frameStartHandle"] = data["frameStart"] - data["handleStart"] + data["frameEndHandle"] = data["frameEnd"] + data["handleEnd"] + + label += " [{0}-{1}]".format(int(data["frameStartHandle"]), + int(data["frameEndHandle"])) instance.data["label"] = label @@ -122,7 +128,6 @@ class CollectInstances(pyblish.api.ContextPlugin): # user interface interested in visualising it. self.log.info("Found: \"%s\" " % instance.data["name"]) self.log.debug("DATA: \"%s\" " % instance.data) - def sort_by_family(instance): """Sort by family""" diff --git a/pype/plugins/maya/publish/collect_render.py b/pype/plugins/maya/publish/collect_render.py index f31198448b..f3ea1ccee5 100644 --- a/pype/plugins/maya/publish/collect_render.py +++ b/pype/plugins/maya/publish/collect_render.py @@ -211,17 +211,19 @@ class CollectMayaRender(pyblish.api.ContextPlugin): "attachTo": attachTo, "setMembers": layer_name, "publish": True, - "frameStart": int(self.get_render_attribute("startFrame", + "frameStart": int(context.data["assetEntity"]['data']['frameStart']), + "frameEnd": int(context.data["assetEntity"]['data']['frameEnd']), + "frameStartHandle": int(self.get_render_attribute("startFrame", layer=layer_name)), - "frameEnd": int(self.get_render_attribute("endFrame", + "frameEndHandle": int(self.get_render_attribute("endFrame", layer=layer_name)), "byFrameStep": int( self.get_render_attribute("byFrameStep", layer=layer_name)), "renderer": self.get_render_attribute("currentRenderer", layer=layer_name), - "handleStart": context.data["assetEntity"]['data']['handleStart'], - "handleEnd": context.data["assetEntity"]['data']['handleEnd'], + "handleStart": int(context.data["assetEntity"]['data']['handleStart']), + "handleEnd": int(context.data["assetEntity"]['data']['handleEnd']), # instance subset "family": "renderlayer", @@ -259,8 +261,8 @@ class CollectMayaRender(pyblish.api.ContextPlugin): # Define nice label label = "{0} ({1})".format(expected_layer_name, data["asset"]) - label += " [{0}-{1}]".format(int(data["frameStart"]), - int(data["frameEnd"])) + label += " [{0}-{1}]".format(int(data["frameStartHandle"]), + int(data["frameEndHandle"])) instance = context.create_instance(expected_layer_name) instance.data["label"] = label diff --git a/pype/plugins/maya/publish/collect_review.py b/pype/plugins/maya/publish/collect_review.py index 18eee78a9c..9b6027b98d 100644 --- a/pype/plugins/maya/publish/collect_review.py +++ b/pype/plugins/maya/publish/collect_review.py @@ -54,8 +54,10 @@ class CollectReview(pyblish.api.InstancePlugin): self.log.debug('adding review family to {}'.format(reviewable_subset)) data['review_camera'] = camera # data["publish"] = False - data['startFrameReview'] = instance.data["frameStart"] - data['endFrameReview'] = instance.data["frameEnd"] + data['frameStartFtrack'] = instance.data["frameStartHandle"] + data['frameEndFtrack'] = instance.data["frameEndHandle"] + data['frameStartHandle'] = instance.data["frameStartHandle"] + data['frameEndHandle'] = instance.data["frameEndHandle"] data["frameStart"] = instance.data["frameStart"] data["frameEnd"] = instance.data["frameEnd"] data['handles'] = instance.data['handles'] @@ -69,8 +71,8 @@ class CollectReview(pyblish.api.InstancePlugin): else: instance.data['subset'] = task + 'Review' instance.data['review_camera'] = camera - instance.data['startFrameReview'] = instance.data["frameStart"] - instance.data['endFrameReview'] = instance.data["frameEnd"] + instance.data['frameStartFtrack'] = instance.data["frameStartHandle"] + instance.data['frameEndFtrack'] = instance.data["frameEndHandle"] # make ftrack publishable instance.data["families"] = ['ftrack'] diff --git a/pype/plugins/maya/publish/submit_maya_deadline.py b/pype/plugins/maya/publish/submit_maya_deadline.py index bd8497152e..7547f34ba1 100644 --- a/pype/plugins/maya/publish/submit_maya_deadline.py +++ b/pype/plugins/maya/publish/submit_maya_deadline.py @@ -234,8 +234,8 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin): "Plugin": instance.data.get("mayaRenderPlugin", "MayaBatch"), "Frames": "{start}-{end}x{step}".format( - start=int(instance.data["frameStart"]), - end=int(instance.data["frameEnd"]), + start=int(instance.data["frameStartHandle"]), + end=int(instance.data["frameEndHandle"]), step=int(instance.data["byFrameStep"]), ), @@ -340,7 +340,7 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin): def preflight_check(self, instance): """Ensure the startFrame, endFrame and byFrameStep are integers""" - for key in ("frameStart", "frameEnd", "byFrameStep"): + for key in ("frameStartHandle", "frameEndHandle", "byFrameStep"): value = instance.data[key] if int(value) == value: From 2017d2315a54a477b324d25e6a0d85e895471967 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 13 Mar 2020 23:52:35 +0100 Subject: [PATCH 05/12] change workfile subset naming in nuke to match other hosts --- pype/plugins/nuke/publish/collect_workfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pype/plugins/nuke/publish/collect_workfile.py b/pype/plugins/nuke/publish/collect_workfile.py index 9c01a3ec97..b95edf0a93 100644 --- a/pype/plugins/nuke/publish/collect_workfile.py +++ b/pype/plugins/nuke/publish/collect_workfile.py @@ -23,11 +23,12 @@ class CollectWorkfile(pyblish.api.ContextPlugin): add_publish_knob(root) family = "workfile" + task = os.getenv("AVALON_TASK", None) # creating instances per write node file_path = context.data["currentFile"] staging_dir = os.path.dirname(file_path) base_name = os.path.basename(file_path) - subset = "{0}_{1}".format(os.getenv("AVALON_TASK", None), family) + subset = family + task.capitalize() # Get frame range first_frame = int(root["first_frame"].getValue()) From bbf03cc11939c9f1fdc013b3be5a247b5d9e1786 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 13 Mar 2020 23:52:55 +0100 Subject: [PATCH 06/12] use handles correctly in deadline job submitter --- pype/plugins/global/publish/submit_publish_job.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pype/plugins/global/publish/submit_publish_job.py b/pype/plugins/global/publish/submit_publish_job.py index 3ad7805fe7..47c0272254 100644 --- a/pype/plugins/global/publish/submit_publish_job.py +++ b/pype/plugins/global/publish/submit_publish_job.py @@ -355,8 +355,6 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): aov) staging = os.path.dirname(list(cols[0])[0]) - start = int(instance_data.get("frameStart")) - end = int(instance_data.get("frameEnd")) self.log.info("Creating data for: {}".format(subset_name)) @@ -377,8 +375,8 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): "name": ext, "ext": ext, "files": [os.path.basename(f) for f in list(cols[0])], - "frameStart": start, - "frameEnd": end, + "frameStart": int(instance_data.get("frameStartHandle")), + "frameEnd": int(instance_data.get("frameEndHandle")), # If expectedFile are absolute, we need only filenames "stagingDir": staging, "anatomy_template": "render", @@ -413,8 +411,6 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): """ representations = [] - start = int(instance.get("frameStart")) - end = int(instance.get("frameEnd")) cols, rem = clique.assemble(exp_files) bake_render_path = instance.get("bakeRenderPath") @@ -442,8 +438,8 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): "name": ext, "ext": ext, "files": [os.path.basename(f) for f in list(c)], - "frameStart": start, - "frameEnd": end, + "frameStart": int(instance.get("frameStartHandle")), + "frameEnd": int(instance.get("frameEndHandle")), # If expectedFile are absolute, we need only filenames "stagingDir": os.path.dirname(list(c)[0]), "anatomy_template": "render", @@ -577,6 +573,8 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): "frameEnd": end, "handleStart": handle_start, "handleEnd": handle_end, + "frameStartHandle": start - handle_start, + "frameEndHandle": end + handle_end, "fps": fps, "source": source, "extendFrames": data.get("extendFrames"), From 394f341fb8d904c98a902d0df1da2c298ba28579 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Sat, 14 Mar 2020 00:09:22 +0100 Subject: [PATCH 07/12] use frameStartHandle in nuke rendering --- pype/nuke/lib.py | 4 ++-- pype/plugins/nuke/publish/submit_nuke_deadline.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pype/nuke/lib.py b/pype/nuke/lib.py index dedc42fa1d..e7720c747c 100644 --- a/pype/nuke/lib.py +++ b/pype/nuke/lib.py @@ -1350,8 +1350,8 @@ class ExporterReview: else: self.fname = os.path.basename(self.path_in) self.fhead = os.path.splitext(self.fname)[0] + "." - self.first_frame = self.instance.data.get("frameStart", None) - self.last_frame = self.instance.data.get("frameEnd", None) + self.first_frame = self.instance.data.get("frameStartHandle", None) + self.last_frame = self.instance.data.get("frameEndHandle", None) if "#" in self.fhead: self.fhead = self.fhead.replace("#", "")[:-1] diff --git a/pype/plugins/nuke/publish/submit_nuke_deadline.py b/pype/plugins/nuke/publish/submit_nuke_deadline.py index ee7432e241..0a9ef33398 100644 --- a/pype/plugins/nuke/publish/submit_nuke_deadline.py +++ b/pype/plugins/nuke/publish/submit_nuke_deadline.py @@ -41,8 +41,8 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin): self._ver = re.search(r"\d+\.\d+", context.data.get("hostVersion")) self._deadline_user = context.data.get( "deadlineUser", getpass.getuser()) - self._frame_start = int(instance.data["frameStart"]) - self._frame_end = int(instance.data["frameEnd"]) + self._frame_start = int(instance.data["frameStartHandle"]) + self._frame_end = int(instance.data["frameEndHandle"]) # get output path render_path = instance.data['path'] From 90f55bcb3d9b30b7cf163d3ed345b4daeb9d0ef4 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Sat, 14 Mar 2020 20:24:56 +0100 Subject: [PATCH 08/12] use frameStartFtrack in hiero --- pype/plugins/nukestudio/publish/collect_reviews.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pype/plugins/nukestudio/publish/collect_reviews.py b/pype/plugins/nukestudio/publish/collect_reviews.py index af8fd4a0e7..7cf8d77de4 100644 --- a/pype/plugins/nukestudio/publish/collect_reviews.py +++ b/pype/plugins/nukestudio/publish/collect_reviews.py @@ -78,6 +78,8 @@ class CollectReviews(api.InstancePlugin): file_dir = os.path.dirname(file_path) file = os.path.basename(file_path) ext = os.path.splitext(file)[-1][1:] + handleStart = rev_inst.data.get("handleStart") + handleEnd = rev_inst.data.get("handleEnd") # change label instance.data["label"] = "{0} - {1} - ({2}) - review".format( @@ -86,13 +88,14 @@ class CollectReviews(api.InstancePlugin): self.log.debug("Instance review: {}".format(rev_inst.data["name"])) - # adding representation for review mov representation = { "files": file, "stagingDir": file_dir, "frameStart": rev_inst.data.get("sourceIn"), "frameEnd": rev_inst.data.get("sourceOut"), + "frameStartFtrack": rev_inst.data.get("sourceIn") - handleStart, + "frameEndFtrack": rev_inst.data.get("sourceOut") + handleEnd, "step": 1, "fps": rev_inst.data.get("fps"), "preview": True, From a78773dc81ddad8f92c886d65969aaec78f6ff98 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Sun, 15 Mar 2020 00:22:58 +0100 Subject: [PATCH 09/12] make sure we fallback to old handles attribute --- pype/plugins/global/publish/collect_avalon_entities.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pype/plugins/global/publish/collect_avalon_entities.py b/pype/plugins/global/publish/collect_avalon_entities.py index 20899361c5..299e2f03be 100644 --- a/pype/plugins/global/publish/collect_avalon_entities.py +++ b/pype/plugins/global/publish/collect_avalon_entities.py @@ -47,6 +47,7 @@ class CollectAvalonEntities(pyblish.api.ContextPlugin): context.data["assetEntity"] = asset_entity data = asset_entity['data'] - context.data['handles'] = int(data.get("handles", 0)) - context.data["handleStart"] = int(data.get("handleStart", 0)) - context.data["handleEnd"] = int(data.get("handleEnd", 0)) + handles = int(data.get("handles", 0)) + context.data["handles"] = handles + context.data["handleStart"] = int(data.get("handleStart", handles)) + context.data["handleEnd"] = int(data.get("handleEnd", handles)) From 37778f57db87e39d7e61901db8cd915f066155e3 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Sun, 15 Mar 2020 00:30:10 +0100 Subject: [PATCH 10/12] rely on ffmpeg start second calculation --- pype/plugins/global/publish/extract_review.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pype/plugins/global/publish/extract_review.py b/pype/plugins/global/publish/extract_review.py index abe3d36758..5c40227494 100644 --- a/pype/plugins/global/publish/extract_review.py +++ b/pype/plugins/global/publish/extract_review.py @@ -183,8 +183,12 @@ class ExtractReview(pyblish.api.InstancePlugin): frame_start_handle, fps)) else: if no_handles: - start_sec = float(handle_start) / fps - input_args.append("-ss {:0.2f}".format(start_sec)) + # start_sec = float(handle_start) / fps + input_args.append( + "-start_number {0} -framerate {1}".format( + handle_start, fps + ) + ) frame_start_handle = frame_start frame_end_handle = frame_end From 317c25a7c52f5a8be517a444737344053431ae85 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Sun, 15 Mar 2020 16:27:55 +0100 Subject: [PATCH 11/12] get frameStartHandle -1 for slate --- pype/plugins/nuke/publish/extract_slate_frame.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/plugins/nuke/publish/extract_slate_frame.py b/pype/plugins/nuke/publish/extract_slate_frame.py index 488f9bd31d..0d8bfe9dc5 100644 --- a/pype/plugins/nuke/publish/extract_slate_frame.py +++ b/pype/plugins/nuke/publish/extract_slate_frame.py @@ -77,7 +77,7 @@ class ExtractSlateFrame(pype.api.Extractor): else: fname = os.path.basename(instance.data.get("path", None)) fhead = os.path.splitext(fname)[0] + "." - first_frame = instance.data.get("frameStart", None) - 1 + first_frame = instance.data.get("frameStartHandle", None) - 1 last_frame = first_frame if "#" in fhead: From 58b563ad046cdb09619eda08559462e62d27e3ad Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Sun, 15 Mar 2020 16:28:10 +0100 Subject: [PATCH 12/12] revert ffmpeg frame calculation --- pype/plugins/global/publish/extract_review.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pype/plugins/global/publish/extract_review.py b/pype/plugins/global/publish/extract_review.py index 5c40227494..abe3d36758 100644 --- a/pype/plugins/global/publish/extract_review.py +++ b/pype/plugins/global/publish/extract_review.py @@ -183,12 +183,8 @@ class ExtractReview(pyblish.api.InstancePlugin): frame_start_handle, fps)) else: if no_handles: - # start_sec = float(handle_start) / fps - input_args.append( - "-start_number {0} -framerate {1}".format( - handle_start, fps - ) - ) + start_sec = float(handle_start) / fps + input_args.append("-ss {:0.2f}".format(start_sec)) frame_start_handle = frame_start frame_end_handle = frame_end