diff --git a/pype/fusion/scripts/fusion_switch_shot.py b/pype/fusion/scripts/fusion_switch_shot.py index 6e6dc04733..9cc572164d 100644 --- a/pype/fusion/scripts/fusion_switch_shot.py +++ b/pype/fusion/scripts/fusion_switch_shot.py @@ -138,8 +138,8 @@ def update_frame_range(comp, representations): versions = io.find({"type": "version", "_id": {"$in": version_ids}}) versions = list(versions) - start = min(v["data"]["startFrame"] for v in versions) - end = max(v["data"]["endFrame"] for v in versions) + start = min(v["data"]["frameStart"] for v in versions) + end = max(v["data"]["frameEnd"] for v in versions) fusion_lib.update_frame_range(start, end, comp=comp) diff --git a/pype/lib.py b/pype/lib.py index e163cc14fc..e35f44f4c1 100644 --- a/pype/lib.py +++ b/pype/lib.py @@ -17,8 +17,8 @@ log = logging.getLogger(__name__) def get_handle_irregular(asset): data = asset["data"] - handle_start = data.get("handle_start", 0) - handle_end = data.get("handle_end", 0) + handle_start = data.get("handleStart", 0) + handle_end = data.get("handleEnd", 0) return (handle_start, handle_end) diff --git a/pype/maya/lib.py b/pype/maya/lib.py index ee2ef57e34..6b6ba7e277 100644 --- a/pype/maya/lib.py +++ b/pype/maya/lib.py @@ -280,8 +280,8 @@ def collect_animation_data(): # build attributes data = OrderedDict() - data["startFrame"] = start - data["endFrame"] = end + data["frameStart"] = start + data["frameEnd"] = end data["handles"] = 0 data["step"] = 1.0 data["fps"] = fps @@ -1866,8 +1866,8 @@ def set_context_settings(): set_scene_fps(fps) # Set project resolution - width_key = "resolution_width" - height_key = "resolution_height" + width_key = "resolutionWidth" + height_key = "resolutionHeight" width = asset_data.get(width_key, project_data.get(width_key, 1920)) height = asset_data.get(height_key, project_data.get(height_key, 1080)) diff --git a/pype/nuke/lib.py b/pype/nuke/lib.py index 515475276c..3ef85b7770 100644 --- a/pype/nuke/lib.py +++ b/pype/nuke/lib.py @@ -459,7 +459,7 @@ def reset_frame_range_handles(): data = asset["data"] missing_cols = [] - check_cols = ["fps", "fstart", "fend", "handle_start", "handle_end"] + check_cols = ["fps", "frameStart", "frameEnd", "handleStart", "handleEnd"] for col in check_cols: if col not in data: @@ -477,26 +477,24 @@ def reset_frame_range_handles(): handle_start, handle_end = pype.get_handle_irregular(asset) fps = asset["data"]["fps"] - edit_in = int(asset["data"]["fstart"]) - handle_start - edit_out = int(asset["data"]["fend"]) + handle_end + frame_start= int(asset["data"]["frameStart"]) - handle_start + frame_end= int(asset["data"]["frameEnd"]) + handle_end root["fps"].setValue(fps) - root["first_frame"].setValue(edit_in) - root["last_frame"].setValue(edit_out) + root["first_frame"].setValue(frame_start) + root["last_frame"].setValue(frame_end) log.info("__ handles: `{}`".format(handles)) log.info("__ handle_start: `{}`".format(handle_start)) log.info("__ handle_end: `{}`".format(handle_end)) - log.info("__ edit_in: `{}`".format(edit_in)) - log.info("__ edit_out: `{}`".format(edit_out)) log.info("__ fps: `{}`".format(fps)) # setting active viewers - nuke.frame(int(asset["data"]["fstart"])) + nuke.frame(int(asset["data"]["frameStart"])) range = '{0}-{1}'.format( - int(asset["data"]["fstart"]), - int(asset["data"]["fend"])) + int(asset["data"]["frameStart"]), + int(asset["data"]["frameEnd"])) for node in nuke.allNodes(filter="Viewer"): node['frame_range'].setValue(range) @@ -510,8 +508,8 @@ def reset_frame_range_handles(): # adding handle_start/end to root avalon knob if not avalon.nuke.set_avalon_knob_data(root, { - "handle_start": int(handle_start), - "handle_end": int(handle_end) + "handleStart": int(handle_start), + "handleEnd": int(handle_end) }): log.warning("Cannot set Avalon knob to Root node!") @@ -532,9 +530,9 @@ def reset_resolution(): asset = api.Session["AVALON_ASSET"] asset = io.find_one({"name": asset, "type": "asset"}) - width = asset.get('data', {}).get('resolution_width') - height = asset.get('data', {}).get('resolution_height') - pixel_aspect = asset.get('data', {}).get('pixel_aspect') + width = asset.get('data', {}).get("resolutionWidth") + height = asset.get('data', {}).get("resolutionHeight") + pixel_aspect = asset.get('data', {}).get("pixelAspect") log.info("pixel_aspect: {}".format(pixel_aspect)) if any(not x for x in [width, height, pixel_aspect]): @@ -575,7 +573,7 @@ def reset_resolution(): crnt_fmt_kargs = { "width": (check_format.width()), "height": (check_format.height()), - "pixel_aspect": float(check_format.pixelAspect()) + "pixelAspect": float(check_format.pixelAspect()) } if bbox: crnt_fmt_kargs.update({ @@ -590,7 +588,7 @@ def reset_resolution(): new_fmt_kargs = { "width": int(width), "height": int(height), - "pixel_aspect": float(pixel_aspect), + "pixelAspect": float(pixel_aspect), "project_name": format_name } if bbox: @@ -668,60 +666,6 @@ def get_hierarchical_attr(entity, attr, default=None): return get_hierarchical_attr(parent, attr) -# TODO: bellow functions are wip and needs to be check where they are used -# ------------------------------------ - -# -# def update_frame_range(start, end, root=None): -# """Set Nuke script start and end frame range -# -# Args: -# start (float, int): start frame -# end (float, int): end frame -# root (object, Optional): root object from nuke's script -# -# Returns: -# None -# -# """ -# -# knobs = { -# "first_frame": start, -# "last_frame": end -# } -# -# with avalon.nuke.viewer_update_and_undo_stop(): -# for key, value in knobs.items(): -# if root: -# root[key].setValue(value) -# else: -# nuke.root()[key].setValue(value) -# -# # -# def get_additional_data(container): -# """Get Nuke's related data for the container -# -# Args: -# container(dict): the container found by the ls() function -# -# Returns: -# dict -# """ -# -# node = container["_node"] -# tile_color = node['tile_color'].value() -# if tile_color is None: -# return {} -# -# hex = '%08x' % tile_color -# rgba = [ -# float(int(hex[0:2], 16)) / 255.0, -# float(int(hex[2:4], 16)) / 255.0, -# float(int(hex[4:6], 16)) / 255.0 -# ] -# -# return {"color": Qt.QtGui.QColor().fromRgbF(rgba[0], rgba[1], rgba[2])} - def get_write_node_template_attr(node): ''' Gets all defined data from presets @@ -747,7 +691,7 @@ def get_write_node_template_attr(node): # adding dataflow template {correct_data.update({k: v}) for k, v in nuke_dataflow_writes.items() - if k not in ["id", "previous"]} + if k not in ["_id", "_previous"]} # adding colorspace template {correct_data.update({k: v}) diff --git a/pype/nukestudio/lib.py b/pype/nukestudio/lib.py index 9adaf380d6..fd9905b3f5 100644 --- a/pype/nukestudio/lib.py +++ b/pype/nukestudio/lib.py @@ -51,9 +51,9 @@ def set_workfiles(): log.info("project_data: {}".format(project_data)) # get format and fps property from avalon db on project - width = project_data['resolution_width'] - height = project_data['resolution_height'] - pixel_aspect = project_data['pixel_aspect'] + width = project_data["resolutionWidth"] + height = project_data["resolutionHeight"] + pixel_aspect = project_data["pixelAspect"] fps = project_data['fps'] format_name = project_data['code'] diff --git a/pype/nukestudio/precomp_clip.py b/pype/nukestudio/precomp_clip.py index 426a13f0c7..b544b6e654 100644 --- a/pype/nukestudio/precomp_clip.py +++ b/pype/nukestudio/precomp_clip.py @@ -14,9 +14,9 @@ def create_nk_script_clips(script_lst, seq=None): 'handles': 10, 'handleStart': 15, # added asymetrically to handles 'handleEnd': 10, # added asymetrically to handles - 'timelineIn': 16, - 'startFrame': 991, - 'endFrame': 1023, + "clipIn": 16, + "frameStart": 991, + "frameEnd": 1023, 'task': 'Comp-tracking', 'work_dir': 'VFX_PR', 'shot': '00010' @@ -55,12 +55,12 @@ def create_nk_script_clips(script_lst, seq=None): if media_in: source_in = media_in + handle_start else: - source_in = nk['startFrame'] + handle_start + source_in = nk["frameStart"] + handle_start if media_duration: source_out = (media_in + media_duration - 1) - handle_end else: - source_out = nk['endFrame'] - handle_end + source_out = nk["frameEnd"] - handle_end print("__ media: `{}`".format(media)) print("__ media_in: `{}`".format(media_in)) @@ -98,8 +98,8 @@ def create_nk_script_clips(script_lst, seq=None): trackItem.setSourceIn(source_in) trackItem.setSourceOut(source_out) trackItem.setSourceIn(source_in) - trackItem.setTimelineIn(nk['timelineIn']) - trackItem.setTimelineOut(nk['timelineIn'] + (source_out - source_in)) + trackItem.setTimelineIn(nk["clipIn"]) + trackItem.setTimelineOut(nk["clipIn"] + (source_out - source_in)) track.addTrackItem(trackItem) track.addTrackItem(trackItem) clips_lst.append(trackItem) @@ -179,9 +179,9 @@ script_lst = [{ 'handles': 10, 'handleStart': 10, 'handleEnd': 10, - 'timelineIn': 16, - 'startFrame': 991, - 'endFrame': 1023, + "clipIn": 16, + "frameStart": 991, + "frameEnd": 1023, 'task': 'platesMain', 'work_dir': 'shots', 'shot': '120sh020' diff --git a/pype/plugins/aport/publish/collect_instances.py b/pype/plugins/aport/publish/collect_instances.py index ffb2ec824c..8dd28a5aff 100644 --- a/pype/plugins/aport/publish/collect_instances.py +++ b/pype/plugins/aport/publish/collect_instances.py @@ -43,15 +43,15 @@ class CollectInstancesFromJson(pyblish.api.ContextPlugin): "type": "asset"}) # get frame start > first try from asset data - frame_start = context.data["assetData"].get("fstart", None) + frame_start = context.data["assetData"].get("frameStart", None) if not frame_start: self.log.debug("frame_start not on assetData") # get frame start > second try from parent data - frame_start = pype.get_data_hierarchical_attr(entity, "fstart") + frame_start = pype.get_data_hierarchical_attr(entity, "frameStart") if not frame_start: self.log.debug("frame_start not on any parent entity") # get frame start > third try from parent data - frame_start = asset_default["fstart"] + frame_start = asset_default["frameStart"] assert frame_start, "No `frame_start` data found, " "please set `fstart` on asset" @@ -129,7 +129,7 @@ class CollectInstancesFromJson(pyblish.api.ContextPlugin): instance.data.update({ "subset": subset_name, "task": task, - "fstart": frame_start, + "frameStart": frame_start, "handles": handles, "host": host, "asset": asset, diff --git a/pype/plugins/ftrack/publish/integrate_ftrack_instances.py b/pype/plugins/ftrack/publish/integrate_ftrack_instances.py index c595178361..976250da00 100644 --- a/pype/plugins/ftrack/publish/integrate_ftrack_instances.py +++ b/pype/plugins/ftrack/publish/integrate_ftrack_instances.py @@ -76,11 +76,11 @@ class IntegrateFtrackInstance(pyblish.api.InstancePlugin): ) else: end_frame += ( - instance.data['endFrame'] - instance.data['startFrame'] + instance.data["frameEnd"] - instance.data["frameStart"] ) - if not comp.get('frameRate'): - comp['frameRate'] = instance.context.data['fps'] + if not comp.get('fps'): + comp['fps'] = instance.context.data['fps'] location = self.get_ftrack_location( 'ftrack.server', ft_session ) @@ -90,7 +90,7 @@ class IntegrateFtrackInstance(pyblish.api.InstancePlugin): "metadata": {'ftr_meta': json.dumps({ 'frameIn': int(start_frame), 'frameOut': int(end_frame), - 'frameRate': float(comp['frameRate'])})} + 'frameRate': float(comp['fps'])})} } comp['thumbnail'] = False else: diff --git a/pype/plugins/fusion/load/actions.py b/pype/plugins/fusion/load/actions.py index d7ee13716b..481c95387f 100644 --- a/pype/plugins/fusion/load/actions.py +++ b/pype/plugins/fusion/load/actions.py @@ -27,8 +27,8 @@ class FusionSetFrameRangeLoader(api.Loader): version = context['version'] version_data = version.get("data", {}) - start = version_data.get("startFrame", None) - end = version_data.get("endFrame", None) + start = version_data.get("frameStart", None) + end = version_data.get("frameEnd", None) if start is None or end is None: print("Skipping setting frame range because start or " @@ -60,8 +60,8 @@ class FusionSetFrameRangeWithHandlesLoader(api.Loader): version = context['version'] version_data = version.get("data", {}) - start = version_data.get("startFrame", None) - end = version_data.get("endFrame", None) + start = version_data.get("frameStart", None) + end = version_data.get("frameEnd", None) if start is None or end is None: print("Skipping setting frame range because start or " diff --git a/pype/plugins/fusion/load/load_sequence.py b/pype/plugins/fusion/load/load_sequence.py index 7b859e9b03..ce6bca6c77 100644 --- a/pype/plugins/fusion/load/load_sequence.py +++ b/pype/plugins/fusion/load/load_sequence.py @@ -145,7 +145,7 @@ class FusionLoadSequence(api.Loader): tool["Clip"] = path # Set global in point to start frame (if in version.data) - start = context["version"]["data"].get("startFrame", None) + start = context["version"]["data"].get("frameStart", None) if start is not None: loader_shift(tool, start, relative=False) @@ -175,7 +175,7 @@ class FusionLoadSequence(api.Loader): been set. - GlobalIn: Fusion reset to comp's global in if duration changes - - We change it to the "startFrame" + - We change it to the "frameStart" - GlobalEnd: Fusion resets to globalIn + length if duration changes - We do the same like Fusion - allow fusion to take control. @@ -212,7 +212,7 @@ class FusionLoadSequence(api.Loader): # Get start frame from version data version = io.find_one({"type": "version", "_id": representation["parent"]}) - start = version["data"].get("startFrame") + start = version["data"].get("frameStart") if start is None: self.log.warning("Missing start frame for updated version" "assuming starts at frame 0 for: " diff --git a/pype/plugins/fusion/publish/collect_instances.py b/pype/plugins/fusion/publish/collect_instances.py index 472e5d4741..6dbb1b1a97 100644 --- a/pype/plugins/fusion/publish/collect_instances.py +++ b/pype/plugins/fusion/publish/collect_instances.py @@ -23,7 +23,7 @@ class CollectInstances(pyblish.api.ContextPlugin): """Collect Fusion saver instances This additionally stores the Comp start and end render range in the - current context's data as "startFrame" and "endFrame". + current context's data as "frameStart" and "frameEnd". """ @@ -43,8 +43,8 @@ class CollectInstances(pyblish.api.ContextPlugin): savers = [tool for tool in tools if tool.ID == "Saver"] start, end = get_comp_render_range(comp) - context.data["startFrame"] = start - context.data["endFrame"] = end + context.data["frameStart"] = start + context.data["frameEnd"] = end for tool in savers: path = tool["Clip"][comp.TIME_UNDEFINED] diff --git a/pype/plugins/fusion/publish/publish_image_sequences.py b/pype/plugins/fusion/publish/publish_image_sequences.py index 26ae74676f..9fe9ddc4cb 100644 --- a/pype/plugins/fusion/publish/publish_image_sequences.py +++ b/pype/plugins/fusion/publish/publish_image_sequences.py @@ -53,8 +53,8 @@ class PublishImageSequence(pyblish.api.InstancePlugin): # The instance has most of the information already stored metadata = { "regex": regex, - "startFrame": instance.context.data["startFrame"], - "endFrame": instance.context.data["endFrame"], + "frameStart": instance.context.data["frameStart"], + "frameEnd": instance.context.data["frameEnd"], "families": ["imagesequence"], } diff --git a/pype/plugins/fusion/publish/submit_deadline.py b/pype/plugins/fusion/publish/submit_deadline.py index 30d17a4c69..6b65f9fe05 100644 --- a/pype/plugins/fusion/publish/submit_deadline.py +++ b/pype/plugins/fusion/publish/submit_deadline.py @@ -79,8 +79,8 @@ class FusionSubmitDeadline(pyblish.api.InstancePlugin): "Plugin": "Fusion", "Frames": "{start}-{end}".format( - start=int(context.data["startFrame"]), - end=int(context.data["endFrame"]) + start=int(context.data["frameStart"]), + end=int(context.data["frameEnd"]) ), "Comment": comment, diff --git a/pype/plugins/global/publish/collect_context.py b/pype/plugins/global/publish/collect_context.py index 11625eaa85..31ab95259c 100644 --- a/pype/plugins/global/publish/collect_context.py +++ b/pype/plugins/global/publish/collect_context.py @@ -67,9 +67,9 @@ class CollectContextDataSAPublish(pyblish.api.ContextPlugin): if isinstance(component['files'], list): collections, remainder = clique.assemble(component['files']) self.log.debug("collecting sequence: {}".format(collections)) - instance.data['startFrame'] = int(component['startFrame']) - instance.data['endFrame'] = int(component['endFrame']) - instance.data['frameRate'] = int(component['frameRate']) + instance.data["frameStart"] = int(component["frameStart"]) + instance.data["frameEnd"] = int(component["frameEnd"]) + instance.data['fps'] = int(component['fps']) instance.data["representations"].append(component) diff --git a/pype/plugins/global/publish/collect_filesequences.py b/pype/plugins/global/publish/collect_filesequences.py index 8b87068a09..33531549cb 100644 --- a/pype/plugins/global/publish/collect_filesequences.py +++ b/pype/plugins/global/publish/collect_filesequences.py @@ -6,14 +6,13 @@ from pprint import pformat import pyblish.api from avalon import api -import pype.api as pype def collect(root, regex=None, exclude_regex=None, - startFrame=None, - endFrame=None): + frame_start=None, + frame_end=None): """Collect sequence collections in root""" from avalon.vendor import clique @@ -52,10 +51,10 @@ def collect(root, # Exclude any frames outside start and end frame. for collection in collections: for index in list(collection.indexes): - if startFrame is not None and index < startFrame: + if frame_start is not None and index < frame_start: collection.indexes.discard(index) continue - if endFrame is not None and index > endFrame: + if frame_end is not None and index > frame_end: collection.indexes.discard(index) continue @@ -77,8 +76,8 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin): api.Session["AVALON_ASSET"] subset (str): The subset to publish to. If not provided the sequence's head (up to frame number) will be used. - startFrame (int): The start frame for the sequence - endFrame (int): The end frame for the sequence + frame_start (int): The start frame for the sequence + frame_end (int): The end frame for the sequence root (str): The path to collect from (can be relative to the .json) regex (str): A regex for the sequence filename exclude_regex (str): A regex for filename to exclude from collection @@ -143,8 +142,8 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin): collections = collect(root=root, regex=regex, exclude_regex=data.get("exclude_regex"), - startFrame=data.get("startFrame"), - endFrame=data.get("endFrame")) + frame_start=data.get("frameStart"), + frame_end=data.get("frameEnd")) self.log.info("Found collections: {}".format(collections)) @@ -179,8 +178,8 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin): # If no start or end frame provided, get it from collection indices = list(collection.indexes) - start = data.get("startFrame", indices[0]) - end = data.get("endFrame", indices[-1]) + start = data.get("frameStart", indices[0]) + end = data.get("frameEnd", indices[-1]) # root = os.path.normpath(root) # self.log.info("Source: {}}".format(data.get("source", ""))) @@ -194,8 +193,8 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin): "subset": subset, "asset": data.get("asset", api.Session["AVALON_ASSET"]), "stagingDir": root, - "startFrame": start, - "endFrame": end, + "frameStart": start, + "frameEnd": end, "fps": fps, "source": data.get('source', '') }) @@ -211,7 +210,7 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin): 'files': list(collection), "stagingDir": root, "anatomy_template": "render", - "frameRate": fps, + "fps": fps, "tags": ['review'] } instance.data["representations"].append(representation) diff --git a/pype/plugins/global/publish/extract_burnin.py b/pype/plugins/global/publish/extract_burnin.py index a0f27f383f..921eb64daf 100644 --- a/pype/plugins/global/publish/extract_burnin.py +++ b/pype/plugins/global/publish/extract_burnin.py @@ -33,7 +33,7 @@ class ExtractBurnin(pype.api.Extractor): "username": instance.context.data['user'], "asset": os.environ['AVALON_ASSET'], "task": os.environ['AVALON_TASK'], - "start_frame": int(instance.data['startFrame']), + "start_frame": int(instance.data["frameStart"]), "version": version } self.log.debug("__ prep_data: {}".format(prep_data)) diff --git a/pype/plugins/global/publish/extract_jpeg.py b/pype/plugins/global/publish/extract_jpeg.py index 3c4c2e6775..a40afa1efc 100644 --- a/pype/plugins/global/publish/extract_jpeg.py +++ b/pype/plugins/global/publish/extract_jpeg.py @@ -22,7 +22,7 @@ class ExtractJpegEXR(pyblish.api.InstancePlugin): def process(self, instance): - start = instance.data.get("startFrame") + start = instance.data.get("frameStart") stagingdir = os.path.normpath(instance.data.get("stagingDir")) collected_frames = os.listdir(stagingdir) diff --git a/pype/plugins/global/publish/extract_review.py b/pype/plugins/global/publish/extract_review.py index 0eb6bfd694..8aa26cd5ad 100644 --- a/pype/plugins/global/publish/extract_review.py +++ b/pype/plugins/global/publish/extract_review.py @@ -29,7 +29,7 @@ class ExtractReview(pyblish.api.InstancePlugin): inst_data = instance.data fps = inst_data.get("fps") - start_frame = inst_data.get("startFrame") + start_frame = inst_data.get("frameStart") self.log.debug("Families In: `{}`".format(instance.data["families"])) diff --git a/pype/plugins/global/publish/integrate.py b/pype/plugins/global/publish/integrate.py index 29a4ba3c17..8597d4a719 100644 --- a/pype/plugins/global/publish/integrate.py +++ b/pype/plugins/global/publish/integrate.py @@ -404,7 +404,7 @@ class IntegrateAsset(pyblish.api.InstancePlugin): # Include optional data if present in optionals = [ - "startFrame", "endFrame", "step", "handles", "sourceHashes" + "frameStart", "frameEnd", "step", "handles", "sourceHashes" ] for key in optionals: if key in instance.data: diff --git a/pype/plugins/global/publish/integrate_new.py b/pype/plugins/global/publish/integrate_new.py index acb5555ba9..fe685c66a1 100644 --- a/pype/plugins/global/publish/integrate_new.py +++ b/pype/plugins/global/publish/integrate_new.py @@ -36,9 +36,9 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): template from anatomy that should be used for integrating this file. Only the first level can be specified right now. - 'startFrame' - 'endFrame' - 'framerate' + "frameStart" + "frameEnd" + 'fps' """ label = "Integrate Asset New" @@ -303,10 +303,10 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): dst_tail = dst_collection.format("{tail}") index_frame_start = None - if repre.get('startFrame'): + if repre.get("frameStart"): frame_start_padding = len(str( - repre.get('endFrame'))) - index_frame_start = repre.get('startFrame') + repre.get("frameEnd"))) + index_frame_start = repre.get("frameStart") dst_padding_exp = src_padding_exp for i in src_collection.indexes: @@ -544,8 +544,8 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): # Include optional data if present in optionals = [ - "startFrame", "endFrame", "step", "handles", - "handle_end", "handle_start", "sourceHashes" + "frameStart", "frameEnd", "step", "handles", + "handleEnd", "handleStart", "sourceHashes" ] for key in optionals: if key in instance.data: diff --git a/pype/plugins/global/publish/integrate_rendered_frames.py b/pype/plugins/global/publish/integrate_rendered_frames.py index ff8d6adc71..cb8f2d8608 100644 --- a/pype/plugins/global/publish/integrate_rendered_frames.py +++ b/pype/plugins/global/publish/integrate_rendered_frames.py @@ -408,7 +408,7 @@ class IntegrateFrames(pyblish.api.InstancePlugin): "comment": context.data.get("comment")} # Include optional data if present in - optionals = ["startFrame", "endFrame", "step", + optionals = ["frameStart", "frameEnd", "step", "handles", "colorspace", "fps", "outputDir"] for key in optionals: diff --git a/pype/plugins/global/publish/submit_publish_job.py b/pype/plugins/global/publish/submit_publish_job.py index 057fd2362c..350b5d2523 100644 --- a/pype/plugins/global/publish/submit_publish_job.py +++ b/pype/plugins/global/publish/submit_publish_job.py @@ -121,7 +121,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): - publishJobState (str, Optional): "Active" or "Suspended" This defaults to "Suspended" - This requires a "startFrame" and "endFrame" to be present in instance.data + This requires a "frameStart" and "frameEnd" to be present in instance.data or in context.data. """ @@ -240,12 +240,12 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): # Get start/end frame from instance, if not available get from context context = instance.context - start = instance.data.get("startFrame") + start = instance.data.get("frameStart") if start is None: - start = context.data["startFrame"] - end = instance.data.get("endFrame") + start = context.data["frameStart"] + end = instance.data.get("frameEnd") if end is None: - end = context.data["endFrame"] + end = context.data["frameEnd"] # Add in regex for sequence filename # This assumes the output files start with subset name and ends with @@ -270,8 +270,8 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): metadata = { "asset": asset, "regex": regex, - "startFrame": start, - "endFrame": end, + "frameStart": start, + "frameEnd": end, "fps": context.data.get("fps", None), "families": ["render"], "source": source, @@ -319,8 +319,8 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): # Set prev start / end frames for comparison if not prev_start and not prev_end: - prev_start = version["data"]["startFrame"] - prev_end = version["data"]["endFrame"] + prev_start = version["data"]["frameStart"] + prev_end = version["data"]["frameEnd"] subset_resources = get_resources(version, _ext) resource_files = get_resource_files(subset_resources, @@ -356,12 +356,12 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): # Please do so when fixing this. # Start frame - metadata["startFrame"] = updated_start - metadata["metadata"]["instance"]["startFrame"] = updated_start + metadata["frameStart"] = updated_start + metadata["metadata"]["instance"]["frameStart"] = updated_start # End frame - metadata["endFrame"] = updated_end - metadata["metadata"]["instance"]["endFrame"] = updated_end + metadata["frameEnd"] = updated_end + metadata["metadata"]["instance"]["frameEnd"] = updated_end metadata_filename = "{}_metadata.json".format(subset) diff --git a/pype/plugins/global/publish/validate_sequence_frames.py b/pype/plugins/global/publish/validate_sequence_frames.py index cd54e6becc..f03229da22 100644 --- a/pype/plugins/global/publish/validate_sequence_frames.py +++ b/pype/plugins/global/publish/validate_sequence_frames.py @@ -22,8 +22,8 @@ class ValidateSequenceFrames(pyblish.api.InstancePlugin): frames = list(collection.indexes) current_range = (frames[0], frames[-1]) - required_range = (instance.data["startFrame"], - instance.data["endFrame"]) + required_range = (instance.data["frameStart"], + instance.data["frameEnd"]) if current_range != required_range: raise ValueError("Invalid frame range: {0} - " diff --git a/pype/plugins/houdini/publish/collect_frames.py b/pype/plugins/houdini/publish/collect_frames.py index 7735d23fb7..7df7d2b86e 100644 --- a/pype/plugins/houdini/publish/collect_frames.py +++ b/pype/plugins/houdini/publish/collect_frames.py @@ -23,8 +23,8 @@ class CollectFrames(pyblish.api.InstancePlugin): match = re.match("(\w+)\.(\d+)\.vdb", file_name) result = file_name - start_frame = instance.data.get("startFrame", None) - end_frame = instance.data.get("endFrame", None) + start_frame = instance.data.get("frameStart", None) + end_frame = instance.data.get("frameEnd", None) if match and start_frame is not None: diff --git a/pype/plugins/houdini/publish/collect_instances.py b/pype/plugins/houdini/publish/collect_instances.py index 5f9fc7d6c9..413553c864 100644 --- a/pype/plugins/houdini/publish/collect_instances.py +++ b/pype/plugins/houdini/publish/collect_instances.py @@ -55,7 +55,7 @@ class CollectInstances(pyblish.api.ContextPlugin): # Create nice name if the instance has a frame range. label = data.get("name", node.name()) - if "startFrame" in data and "endFrame" in data: + if "frameStart" in data and "frameEnd" in data: frames = "[{startFrame} - {endFrame}]".format(**data) label = "{} {}".format(label, frames) @@ -91,8 +91,8 @@ class CollectInstances(pyblish.api.ContextPlugin): if node.evalParm("trange") == 0: return data - data["startFrame"] = node.evalParm("f1") - data["endFrame"] = node.evalParm("f2") + data["frameStart"] = node.evalParm("f1") + data["frameEnd"] = node.evalParm("f2") data["steps"] = node.evalParm("f3") return data diff --git a/pype/plugins/maya/create/create_vrayproxy.py b/pype/plugins/maya/create/create_vrayproxy.py index f3e6124e1f..010157ca9a 100644 --- a/pype/plugins/maya/create/create_vrayproxy.py +++ b/pype/plugins/maya/create/create_vrayproxy.py @@ -13,8 +13,8 @@ class CreateVrayProxy(avalon.maya.Creator): super(CreateVrayProxy, self).__init__(*args, **kwargs) self.data["animation"] = False - self.data["startFrame"] = 1 - self.data["endFrame"] = 1 + self.data["frameStart"] = 1 + self.data["frameEnd"] = 1 # Write vertex colors self.data["vertexColors"] = False diff --git a/pype/plugins/maya/load/actions.py b/pype/plugins/maya/load/actions.py index 6db3c6ba34..60316aaf9b 100644 --- a/pype/plugins/maya/load/actions.py +++ b/pype/plugins/maya/load/actions.py @@ -25,8 +25,8 @@ class SetFrameRangeLoader(api.Loader): version = context['version'] version_data = version.get("data", {}) - start = version_data.get("startFrame", None) - end = version_data.get("endFrame", None) + start = version_data.get("frameStart", None) + end = version_data.get("frameEnd", None) if start is None or end is None: print("Skipping setting frame range because start or " @@ -59,8 +59,8 @@ class SetFrameRangeWithHandlesLoader(api.Loader): version = context['version'] version_data = version.get("data", {}) - start = version_data.get("startFrame", None) - end = version_data.get("endFrame", None) + start = version_data.get("frameStart", None) + end = version_data.get("frameEnd", None) if start is None or end is None: print("Skipping setting frame range because start or " diff --git a/pype/plugins/maya/publish/collect_instances.py b/pype/plugins/maya/publish/collect_instances.py index fd22085556..f17072a505 100644 --- a/pype/plugins/maya/publish/collect_instances.py +++ b/pype/plugins/maya/publish/collect_instances.py @@ -106,9 +106,9 @@ class CollectInstances(pyblish.api.ContextPlugin): data["asset"]) # Append start frame and end frame to label if present - if "startFrame" and "endFrame" in data: - label += " [{0}-{1}]".format(int(data["startFrame"]), - int(data["endFrame"])) + if "frameStart" and "frameEnd" in data: + label += " [{0}-{1}]".format(int(data["frameStart"]), + int(data["frameEnd"])) instance.data["label"] = label diff --git a/pype/plugins/maya/publish/collect_mayaascii.py b/pype/plugins/maya/publish/collect_mayaascii.py index fbed8e0ead..b02f61b7c6 100644 --- a/pype/plugins/maya/publish/collect_mayaascii.py +++ b/pype/plugins/maya/publish/collect_mayaascii.py @@ -15,8 +15,8 @@ class CollectMayaAscii(pyblish.api.InstancePlugin): def process(self, instance): # Extract only current frame (override) frame = cmds.currentTime(query=True) - instance.data['startFrame'] = frame - instance.data['endFrame'] = frame + instance.data["frameStart"] = frame + instance.data["frameEnd"] = frame # make ftrack publishable if instance.data.get('families'): diff --git a/pype/plugins/maya/publish/collect_model.py b/pype/plugins/maya/publish/collect_model.py index b412edf1e9..557f96fe7a 100644 --- a/pype/plugins/maya/publish/collect_model.py +++ b/pype/plugins/maya/publish/collect_model.py @@ -22,5 +22,5 @@ class CollectModelData(pyblish.api.InstancePlugin): def process(self, instance): # Extract only current frame (override) frame = cmds.currentTime(query=True) - instance.data['startFrame'] = frame - instance.data['endFrame'] = frame + instance.data["frameStart"] = frame + instance.data["frameEnd"] = frame diff --git a/pype/plugins/maya/publish/collect_renderlayers.py b/pype/plugins/maya/publish/collect_renderlayers.py index fd916154c1..593ab2e74d 100644 --- a/pype/plugins/maya/publish/collect_renderlayers.py +++ b/pype/plugins/maya/publish/collect_renderlayers.py @@ -64,9 +64,9 @@ class CollectMayaRenderlayers(pyblish.api.ContextPlugin): "subset": layername, "setMembers": layer, "publish": True, - "startFrame": self.get_render_attribute("startFrame", + "frameStart": self.get_render_attribute("frameStart", layer=layer), - "endFrame": self.get_render_attribute("endFrame", + "frameEnd": self.get_render_attribute("frameEnd", layer=layer), "byFrameStep": self.get_render_attribute("byFrameStep", layer=layer), @@ -106,8 +106,8 @@ class CollectMayaRenderlayers(pyblish.api.ContextPlugin): # Define nice label label = "{0} ({1})".format(layername, data["asset"]) - label += " [{0}-{1}]".format(int(data["startFrame"]), - int(data["endFrame"])) + label += " [{0}-{1}]".format(int(data["frameStart"]), + int(data["frameEnd"])) instance = context.create_instance(layername) instance.data["label"] = label diff --git a/pype/plugins/maya/publish/collect_review.py b/pype/plugins/maya/publish/collect_review.py index c434bda49d..7c904cd7d8 100644 --- a/pype/plugins/maya/publish/collect_review.py +++ b/pype/plugins/maya/publish/collect_review.py @@ -54,10 +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['startFrame'] - data['endFrameReview'] = instance.data['endFrame'] - data['startFrame'] = instance.data['startFrame'] - data['endFrame'] = instance.data['endFrame'] + data['startFrameReview'] = instance.data["frameStart"] + data['endFrameReview'] = instance.data["frameEnd"] + data["frameStart"] = instance.data["frameStart"] + data["frameEnd"] = instance.data["frameEnd"] data['handles'] = instance.data['handles'] data['step'] = instance.data['step'] data['fps'] = instance.data['fps'] @@ -69,8 +69,8 @@ class CollectReview(pyblish.api.InstancePlugin): else: instance.data['subset'] = task + 'Review' instance.data['review_camera'] = camera - instance.data['startFrameReview'] = instance.data['startFrame'] - instance.data['endFrameReview'] = instance.data['endFrame'] + instance.data['startFrameReview'] = instance.data["frameStart"] + instance.data['endFrameReview'] = instance.data["frameEnd"] # make ftrack publishable instance.data["families"] = ['ftrack'] diff --git a/pype/plugins/maya/publish/collect_vray_scene.py b/pype/plugins/maya/publish/collect_vray_scene.py index 89c0aa8670..211b212a76 100644 --- a/pype/plugins/maya/publish/collect_vray_scene.py +++ b/pype/plugins/maya/publish/collect_vray_scene.py @@ -82,8 +82,8 @@ class CollectVRayScene(pyblish.api.ContextPlugin): "subset": subset, "setMembers": layer, - "startFrame": start_frame, - "endFrame": end_frame, + "frameStart": start_frame, + "frameEnd": end_frame, "renderer": "vray", "resolution": resolution, "ext": ".{}".format(extension), diff --git a/pype/plugins/maya/publish/collect_yeti_rig.py b/pype/plugins/maya/publish/collect_yeti_rig.py index 469651a891..a2cd5b2a5f 100644 --- a/pype/plugins/maya/publish/collect_yeti_rig.py +++ b/pype/plugins/maya/publish/collect_yeti_rig.py @@ -45,8 +45,8 @@ class CollectYetiRig(pyblish.api.InstancePlugin): instance.data["resources"] = yeti_resources # Force frame range for export - instance.data["startFrame"] = 1 - instance.data["endFrame"] = 1 + instance.data["frameStart"] = 1 + instance.data["frameEnd"] = 1 def collect_input_connections(self, instance): """Collect the inputs for all nodes in the input_SET""" diff --git a/pype/plugins/maya/publish/extract_animation.py b/pype/plugins/maya/publish/extract_animation.py index 794a80e7a6..a3daf96639 100644 --- a/pype/plugins/maya/publish/extract_animation.py +++ b/pype/plugins/maya/publish/extract_animation.py @@ -35,8 +35,8 @@ class ExtractAnimation(pype.api.Extractor): fullPath=True) or [] # Collect the start and end including handles - start = instance.data["startFrame"] - end = instance.data["endFrame"] + start = instance.data["frameStart"] + end = instance.data["frameEnd"] handles = instance.data.get("handles", 0) if handles: start -= handles diff --git a/pype/plugins/maya/publish/extract_camera_alembic.py b/pype/plugins/maya/publish/extract_camera_alembic.py index 77e055daa6..e0e3f8407d 100644 --- a/pype/plugins/maya/publish/extract_camera_alembic.py +++ b/pype/plugins/maya/publish/extract_camera_alembic.py @@ -23,8 +23,8 @@ class ExtractCameraAlembic(pype.api.Extractor): def process(self, instance): # get settings - framerange = [instance.data.get("startFrame", 1), - instance.data.get("endFrame", 1)] + framerange = [instance.data.get("frameStart", 1), + instance.data.get("frameEnd", 1)] handles = instance.data.get("handles", 0) step = instance.data.get("step", 1.0) bake_to_worldspace = instance.data("bakeToWorldSpace", True) diff --git a/pype/plugins/maya/publish/extract_camera_mayaAscii.py b/pype/plugins/maya/publish/extract_camera_mayaAscii.py index cafee6593d..30f686f6f5 100644 --- a/pype/plugins/maya/publish/extract_camera_mayaAscii.py +++ b/pype/plugins/maya/publish/extract_camera_mayaAscii.py @@ -88,8 +88,8 @@ class ExtractCameraMayaAscii(pype.api.Extractor): def process(self, instance): # get settings - framerange = [instance.data.get("startFrame", 1), - instance.data.get("endFrame", 1)] + framerange = [instance.data.get("frameStart", 1), + instance.data.get("frameEnd", 1)] handles = instance.data.get("handles", 0) step = instance.data.get("step", 1.0) bake_to_worldspace = instance.data("bakeToWorldSpace", True) diff --git a/pype/plugins/maya/publish/extract_fbx.py b/pype/plugins/maya/publish/extract_fbx.py index 73d56f9a2c..01b58241c2 100644 --- a/pype/plugins/maya/publish/extract_fbx.py +++ b/pype/plugins/maya/publish/extract_fbx.py @@ -166,8 +166,8 @@ class ExtractFBX(pype.api.Extractor): self.log.info("Export options: {0}".format(options)) # Collect the start and end including handles - start = instance.data["startFrame"] - end = instance.data["endFrame"] + start = instance.data["frameStart"] + end = instance.data["frameEnd"] handles = instance.data.get("handles", 0) if handles: start -= handles diff --git a/pype/plugins/maya/publish/extract_pointcache.py b/pype/plugins/maya/publish/extract_pointcache.py index 0879a4bfe3..cec4886712 100644 --- a/pype/plugins/maya/publish/extract_pointcache.py +++ b/pype/plugins/maya/publish/extract_pointcache.py @@ -25,8 +25,8 @@ class ExtractAlembic(pype.api.Extractor): nodes = instance[:] # Collect the start and end including handles - start = instance.data.get("startFrame", 1) - end = instance.data.get("endFrame", 1) + start = instance.data.get("frameStart", 1) + end = instance.data.get("frameEnd", 1) handles = instance.data.get("handles", 0) if handles: start -= handles diff --git a/pype/plugins/maya/publish/extract_quicktime.py b/pype/plugins/maya/publish/extract_quicktime.py index 87608af641..8c24b363be 100644 --- a/pype/plugins/maya/publish/extract_quicktime.py +++ b/pype/plugins/maya/publish/extract_quicktime.py @@ -114,9 +114,9 @@ class ExtractQuicktime(pype.api.Extractor): 'ext': 'mov', 'files': collected_frames, "stagingDir": stagingdir, - 'startFrame': start, - 'endFrame': end, - 'frameRate': fps, + "frameStart": start, + "frameEnd": end, + 'fps': fps, 'preview': True, 'tags': ['review'] } diff --git a/pype/plugins/maya/publish/extract_vrayproxy.py b/pype/plugins/maya/publish/extract_vrayproxy.py index dcaa910730..fe07159b65 100644 --- a/pype/plugins/maya/publish/extract_vrayproxy.py +++ b/pype/plugins/maya/publish/extract_vrayproxy.py @@ -28,14 +28,14 @@ class ExtractVRayProxy(pype.api.Extractor): if not anim_on: # Remove animation information because it is not required for # non-animated subsets - instance.data.pop("startFrame", None) - instance.data.pop("endFrame", None) + instance.data.pop("frameStart", None) + instance.data.pop("frameEnd", None) start_frame = 1 end_frame = 1 else: - start_frame = instance.data["startFrame"] - end_frame = instance.data["endFrame"] + start_frame = instance.data["frameStart"] + end_frame = instance.data["frameEnd"] vertex_colors = instance.data.get("vertexColors", False) diff --git a/pype/plugins/maya/publish/extract_yeti_cache.py b/pype/plugins/maya/publish/extract_yeti_cache.py index e8cbb02b25..cc71052761 100644 --- a/pype/plugins/maya/publish/extract_yeti_cache.py +++ b/pype/plugins/maya/publish/extract_yeti_cache.py @@ -31,8 +31,8 @@ class ExtractYetiCache(pype.api.Extractor): data_file = os.path.join(dirname, "yeti.fursettings") # Collect information for writing cache - start_frame = instance.data.get("startFrame") - end_frame = instance.data.get("endFrame") + start_frame = instance.data.get("frameStart") + end_frame = instance.data.get("frameEnd") preroll = instance.data.get("preroll") if preroll > 0: start_frame -= preroll diff --git a/pype/plugins/maya/publish/submit_maya_deadline.py b/pype/plugins/maya/publish/submit_maya_deadline.py index 6264609fdf..a9017e5178 100644 --- a/pype/plugins/maya/publish/submit_maya_deadline.py +++ b/pype/plugins/maya/publish/submit_maya_deadline.py @@ -182,8 +182,8 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin): "Plugin": instance.data.get("mayaRenderPlugin", "MayaBatch"), "Frames": "{start}-{end}x{step}".format( - start=int(instance.data["startFrame"]), - end=int(instance.data["endFrame"]), + start=int(instance.data["frameStart"]), + end=int(instance.data["frameEnd"]), step=int(instance.data["byFrameStep"]), ), @@ -330,7 +330,7 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin): def preflight_check(self, instance): """Ensure the startFrame, endFrame and byFrameStep are integers""" - for key in ("startFrame", "endFrame", "byFrameStep"): + for key in ("frameStart", "frameEnd", "byFrameStep"): value = instance.data[key] if int(value) == value: diff --git a/pype/plugins/maya/publish/submit_maya_muster.py b/pype/plugins/maya/publish/submit_maya_muster.py index f4f3f3fe14..0099cbcaeb 100644 --- a/pype/plugins/maya/publish/submit_maya_muster.py +++ b/pype/plugins/maya/publish/submit_maya_muster.py @@ -389,8 +389,8 @@ class MayaSubmitMuster(pyblish.api.InstancePlugin): }, "frames_range": { "value": "{start}-{end}".format( - start=int(instance.data["startFrame"]), - end=int(instance.data["endFrame"])), + start=int(instance.data["frameStart"]), + end=int(instance.data["frameEnd"])), "state": True, "subst": False }, @@ -539,7 +539,7 @@ class MayaSubmitMuster(pyblish.api.InstancePlugin): def preflight_check(self, instance): """Ensure the startFrame, endFrame and byFrameStep are integers""" - for key in ("startFrame", "endFrame", "byFrameStep"): + for key in ("frameStart", "frameEnd", "byFrameStep"): value = instance.data[key] if int(value) == value: diff --git a/pype/plugins/maya/publish/submit_vray_deadline.py b/pype/plugins/maya/publish/submit_vray_deadline.py index fab6d8ff43..8854edec03 100644 --- a/pype/plugins/maya/publish/submit_vray_deadline.py +++ b/pype/plugins/maya/publish/submit_vray_deadline.py @@ -51,8 +51,8 @@ class VraySubmitDeadline(pyblish.api.InstancePlugin): filename, vrscene_output) - start_frame = int(instance.data["startFrame"]) - end_frame = int(instance.data["endFrame"]) + start_frame = int(instance.data["frameStart"]) + end_frame = int(instance.data["frameEnd"]) # Primary job self.log.info("Submitting export job ..") @@ -123,8 +123,8 @@ class VraySubmitDeadline(pyblish.api.InstancePlugin): self.log.info("Submitting render job ..") - start_frame = int(instance.data["startFrame"]) - end_frame = int(instance.data["endFrame"]) + start_frame = int(instance.data["frameStart"]) + end_frame = int(instance.data["frameEnd"]) ext = instance.data.get("ext", "exr") # Create output directory for renders @@ -215,8 +215,8 @@ class VraySubmitDeadline(pyblish.api.InstancePlugin): return cmd.format(project=instance.context.data["workspaceDir"], cam=cammera, - startFrame=instance.data["startFrame"], - endFrame=instance.data["endFrame"], + startFrame=instance.data["frameStart"], + endFrame=instance.data["frameEnd"], layer=instance.name) def build_jobinfo_environment(self, env): @@ -266,7 +266,7 @@ class VraySubmitDeadline(pyblish.api.InstancePlugin): if dir: return output_path.replace("\\", "/") - start_frame = int(instance.data["startFrame"]) + start_frame = int(instance.data["frameStart"]) filename_zero = "{}_{:04d}.vrscene".format(output_path, start_frame) result = filename_zero.replace("\\", "/") diff --git a/pype/plugins/maya/publish/validate_frame_range.py b/pype/plugins/maya/publish/validate_frame_range.py index 78bce85b96..57eb40eb7c 100644 --- a/pype/plugins/maya/publish/validate_frame_range.py +++ b/pype/plugins/maya/publish/validate_frame_range.py @@ -25,8 +25,8 @@ class ValidateFrameRange(pyblish.api.InstancePlugin): def process(self, instance): - start = instance.data.get("startFrame", None) - end = instance.data.get("endFrame", None) + start = instance.data.get("frameStart", None) + end = instance.data.get("frameEnd", None) handles = instance.data.get("handles", None) # Check if any of the values are present diff --git a/pype/plugins/maya/publish/validate_instancer_frame_ranges.py b/pype/plugins/maya/publish/validate_instancer_frame_ranges.py index f31014e6e9..3514cf0a98 100644 --- a/pype/plugins/maya/publish/validate_instancer_frame_ranges.py +++ b/pype/plugins/maya/publish/validate_instancer_frame_ranges.py @@ -51,8 +51,8 @@ class ValidateInstancerFrameRanges(pyblish.api.InstancePlugin): import pyseq - start_frame = instance.data.get("startFrame", 0) - end_frame = instance.data.get("endFrame", 0) + start_frame = instance.data.get("frameStart", 0) + end_frame = instance.data.get("frameEnd", 0) required = range(int(start_frame), int(end_frame) + 1) invalid = list() diff --git a/pype/plugins/maya/publish/validate_vrayproxy.py b/pype/plugins/maya/publish/validate_vrayproxy.py index c5303c8ec3..3eceace76d 100644 --- a/pype/plugins/maya/publish/validate_vrayproxy.py +++ b/pype/plugins/maya/publish/validate_vrayproxy.py @@ -23,5 +23,5 @@ class ValidateVrayProxy(pyblish.api.InstancePlugin): cls.log.error("'%s' is empty! This is a bug" % instance.name) if data["animation"]: - if data["endFrame"] < data["startFrame"]: + if data["frameEnd"] < data["frameStart"]: cls.log.error("End frame is smaller than start frame") diff --git a/pype/plugins/nuke/_publish_unused/publish_image_sequences.py b/pype/plugins/nuke/_publish_unused/publish_image_sequences.py index e8b468e94a..34634dcc6b 100644 --- a/pype/plugins/nuke/_publish_unused/publish_image_sequences.py +++ b/pype/plugins/nuke/_publish_unused/publish_image_sequences.py @@ -53,8 +53,8 @@ class PublishImageSequence(pyblish.api.InstancePlugin): # The instance has most of the information already stored metadata = { "regex": regex, - "startFrame": instance.context.data["startFrame"], - "endFrame": instance.context.data["endFrame"], + "frameStart": instance.context.data["frameStart"], + "frameEnd": instance.context.data["frameEnd"], "families": ["imagesequence"], } diff --git a/pype/plugins/nuke/_publish_unused/submit_deadline.py b/pype/plugins/nuke/_publish_unused/submit_deadline.py index b5476876e0..8b86189425 100644 --- a/pype/plugins/nuke/_publish_unused/submit_deadline.py +++ b/pype/plugins/nuke/_publish_unused/submit_deadline.py @@ -78,8 +78,8 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin): "Plugin": "Nuke", "Frames": "{start}-{end}".format( - start=int(instance.data["startFrame"]), - end=int(instance.data["endFrame"]) + start=int(instance.data["frameStart"]), + end=int(instance.data["frameEnd"]) ), "Comment": comment, diff --git a/pype/plugins/nuke/_publish_unused/validate_nuke_settings.py b/pype/plugins/nuke/_publish_unused/validate_nuke_settings.py index 4fbf1ac56c..dd66b4fb3a 100644 --- a/pype/plugins/nuke/_publish_unused/validate_nuke_settings.py +++ b/pype/plugins/nuke/_publish_unused/validate_nuke_settings.py @@ -19,10 +19,10 @@ class ValidateSettingsNuke(pyblish.api.Validator): asset = io.find_one({"name": os.environ['AVALON_ASSET']}) try: avalon_resolution = asset["data"].get("resolution", '') - avalon_pixel_aspect = asset["data"].get("pixel_aspect", '') + avalon_pixel_aspect = asset["data"].get("pixelAspect", '') avalon_fps = asset["data"].get("fps", '') - avalon_first = asset["data"].get("edit_in", '') - avalon_last = asset["data"].get("edit_out", '') + avalon_first = asset["data"].get("frameStart", '') + avalon_last = asset["data"].get("frameEnd", '') avalon_crop = asset["data"].get("crop", '') except KeyError: print( diff --git a/pype/plugins/nuke/load/actions.py b/pype/plugins/nuke/load/actions.py index 917e7e71b0..a435633fd6 100644 --- a/pype/plugins/nuke/load/actions.py +++ b/pype/plugins/nuke/load/actions.py @@ -30,8 +30,8 @@ class SetFrameRangeLoader(api.Loader): version = context['version'] version_data = version.get("data", {}) - start = version_data.get("startFrame", None) - end = version_data.get("endFrame", None) + start = version_data.get("frameStart", None) + end = version_data.get("frameEnd", None) log.info("start: {}, end: {}".format(start, end)) if start is None or end is None: @@ -64,8 +64,8 @@ class SetFrameRangeWithHandlesLoader(api.Loader): version = context['version'] version_data = version.get("data", {}) - start = version_data.get("startFrame", None) - end = version_data.get("endFrame", None) + start = version_data.get("frameStart", None) + end = version_data.get("frameEnd", None) if start is None or end is None: print("Skipping setting frame range because start or " diff --git a/pype/plugins/nuke/load/load_mov.py b/pype/plugins/nuke/load/load_mov.py index a1e0602620..3079f4053a 100644 --- a/pype/plugins/nuke/load/load_mov.py +++ b/pype/plugins/nuke/load/load_mov.py @@ -92,8 +92,8 @@ class LoadMov(api.Loader): version = context['version'] version_data = version.get("data", {}) - orig_first = version_data.get("startFrame", None) - orig_last = version_data.get("endFrame", None) + orig_first = version_data.get("frameStart", None) + orig_last = version_data.get("frameEnd", None) diff = orig_first - 1 # set first to 1 first = orig_first - diff @@ -141,7 +141,7 @@ class LoadMov(api.Loader): read_node["frame"].setValue(str(offset_frame)) # add additional metadata from the version to imprint to Avalon knob add_keys = [ - "startFrame", "endFrame", "handles", "source", "author", + "frameStart", "frameEnd", "handles", "source", "author", "fps", "version", "handleStart", "handleEnd" ] @@ -207,8 +207,8 @@ class LoadMov(api.Loader): version_data = version.get("data", {}) - orig_first = version_data.get("startFrame", None) - orig_last = version_data.get("endFrame", None) + orig_first = version_data.get("frameStart", None) + orig_last = version_data.get("frameEnd", None) diff = orig_first - 1 # set first to 1 first = orig_first - diff @@ -250,8 +250,8 @@ class LoadMov(api.Loader): updated_dict = {} updated_dict.update({ "representation": str(representation["_id"]), - "startFrame": version_data.get("startFrame"), - "endFrame": version_data.get("endFrame"), + "frameStart": version_data.get("frameStart"), + "frameEnd": version_data.get("frameEnd"), "version": version.get("name"), "source": version_data.get("source"), "handles": version_data.get("handles"), diff --git a/pype/plugins/nuke/load/load_script_precomp.py b/pype/plugins/nuke/load/load_script_precomp.py index bc63150206..0b66cfdaec 100644 --- a/pype/plugins/nuke/load/load_script_precomp.py +++ b/pype/plugins/nuke/load/load_script_precomp.py @@ -27,8 +27,8 @@ class LinkAsGroup(api.Loader): version_data = version.get("data", {}) vname = version.get("name", None) - first = version_data.get("startFrame", None) - last = version_data.get("endFrame", None) + first = version_data.get("frameStart", None) + last = version_data.get("frameEnd", None) # Fallback to asset name when namespace is None if namespace is None: @@ -41,17 +41,14 @@ class LinkAsGroup(api.Loader): self.log.info("versionData: {}\n".format(context["version"]["data"])) - # Set global in point to start frame (if in version.data) - start = context["version"]["data"].get("startFrame", None) - self.log.info("start: {}\n".format(start)) # add additional metadata from the version to imprint to Avalon knob - add_keys = ["startFrame", "endFrame", "handle_start", "handle_end", "source", "author", "fps"] + add_keys = ["frameStart", "frameEnd", "handleStart", "handleEnd", "source", "author", "fps"] data_imprint = { - "start_frame": start, - "fstart": first, - "fend": last, + "start_frame": first, + "frameStart": first, + "frameEnd": last, "version": vname } for k in add_keys: @@ -138,7 +135,7 @@ class LinkAsGroup(api.Loader): updated_dict = {} updated_dict.update({ "representation": str(representation["_id"]), - "endFrame": version["data"].get("endFrame"), + "frameEnd": version["data"].get("frameEnd"), "version": version.get("name"), "colorspace": version["data"].get("colorspace"), "source": version["data"].get("source"), diff --git a/pype/plugins/nuke/load/load_sequence.py b/pype/plugins/nuke/load/load_sequence.py index b2affb3563..61622a07a0 100644 --- a/pype/plugins/nuke/load/load_sequence.py +++ b/pype/plugins/nuke/load/load_sequence.py @@ -92,8 +92,8 @@ class LoadSequence(api.Loader): version = context['version'] version_data = version.get("data", {}) - first = version_data.get("startFrame", None) - last = version_data.get("endFrame", None) + first = version_data.get("frameStart", None) + last = version_data.get("frameEnd", None) handles = version_data.get("handles", 0) handle_start = version_data.get("handleStart", 0) handle_end = version_data.get("handleEnd", 0) @@ -136,7 +136,7 @@ class LoadSequence(api.Loader): r["last"].setValue(int(last)) # add additional metadata from the version to imprint to Avalon knob - add_keys = ["startFrame", "endFrame", "handles", + add_keys = ["frameStart", "frameEnd", "handles", "source", "colorspace", "author", "fps", "version", "handleStart", "handleEnd"] @@ -198,8 +198,8 @@ class LoadSequence(api.Loader): version_data = version.get("data", {}) - first = version_data.get("startFrame", None) - last = version_data.get("endFrame", None) + first = version_data.get("frameStart", None) + last = version_data.get("frameEnd", None) handles = version_data.get("handles", 0) handle_start = version_data.get("handleStart", 0) handle_end = version_data.get("handleEnd", 0) @@ -234,8 +234,8 @@ class LoadSequence(api.Loader): updated_dict = {} updated_dict.update({ "representation": str(representation["_id"]), - "startFrame": version_data.get("startFrame"), - "endFrame": version_data.get("endFrame"), + "frameStart": version_data.get("frameStart"), + "frameEnd": version_data.get("frameEnd"), "version": version.get("name"), "colorspace": version_data.get("colorspace"), "source": version_data.get("source"), diff --git a/pype/plugins/nuke/publish/collect_framerate.py b/pype/plugins/nuke/publish/collect_framerate.py index 980ec22872..88a449e745 100644 --- a/pype/plugins/nuke/publish/collect_framerate.py +++ b/pype/plugins/nuke/publish/collect_framerate.py @@ -14,5 +14,4 @@ class CollectFramerate(pyblish.api.ContextPlugin): ] def process(self, context): - context.data["framerate"] = nuke.root()["fps"].getValue() context.data["fps"] = nuke.root()["fps"].getValue() diff --git a/pype/plugins/nuke/publish/collect_reads.py b/pype/plugins/nuke/publish/collect_reads.py index 1bba6198d2..352ae129f4 100644 --- a/pype/plugins/nuke/publish/collect_reads.py +++ b/pype/plugins/nuke/publish/collect_reads.py @@ -99,8 +99,8 @@ class CollectNukeReads(pyblish.api.ContextPlugin): "stagingDir": source_dir, "ext": ext, "label": label, - "startFrame": first_frame, - "endFrame": last_frame, + "frameStart": first_frame, + "frameEnd": last_frame, "colorspace": node["colorspace"].value(), "handles": int(asset_data["data"].get("handles", 0)), "step": 1, diff --git a/pype/plugins/nuke/publish/collect_workfile.py b/pype/plugins/nuke/publish/collect_workfile.py index 2ec6464ace..1e0ecb33f6 100644 --- a/pype/plugins/nuke/publish/collect_workfile.py +++ b/pype/plugins/nuke/publish/collect_workfile.py @@ -38,8 +38,8 @@ class CollectWorkfile(pyblish.api.ContextPlugin): first_frame = int(root["first_frame"].getValue()) last_frame = int(root["last_frame"].getValue()) - handle_start = int(knob_data.get("handle_start", 0)) - handle_end = int(knob_data.get("handle_end", 0)) + handle_start = int(knob_data.get("handleStart", 0)) + handle_end = int(knob_data.get("handleEnd", 0)) # Get format format = root['format'].value() @@ -54,17 +54,17 @@ class CollectWorkfile(pyblish.api.ContextPlugin): script_data = { "asset": os.getenv("AVALON_ASSET", None), "version": version, - "startFrame": first_frame + handle_start, - "endFrame": last_frame - handle_end, - "resolution_width": resolution_width, - "resolution_height": resolution_height, - "pixel_aspect": pixel_aspect, + "frameStart": first_frame + handle_start, + "frameEnd": last_frame - handle_end, + "resolutionWidth": resolution_width, + "resolutionHeight": resolution_height, + "pixelAspect": pixel_aspect, # backward compatibility "handles": handle_start, - "handle_start": handle_start, - "handle_end": handle_end, + "handleStart": handle_start, + "handleEnd": handle_end, "step": 1, "fps": root['fps'].value(), } diff --git a/pype/plugins/nuke/publish/collect_writes.py b/pype/plugins/nuke/publish/collect_writes.py index f98a3a0f7d..2430a18065 100644 --- a/pype/plugins/nuke/publish/collect_writes.py +++ b/pype/plugins/nuke/publish/collect_writes.py @@ -91,8 +91,8 @@ class CollectNukeWrites(pyblish.api.InstancePlugin): "ext": ext, "label": label, "handles": handles, - "startFrame": first_frame, - "endFrame": last_frame, + "frameStart": first_frame, + "frameEnd": last_frame, "outputType": output_type, "colorspace": node["colorspace"].value(), }) diff --git a/pype/plugins/nuke/publish/extract_render_local.py b/pype/plugins/nuke/publish/extract_render_local.py index 2b185720a6..78bb1ca63f 100644 --- a/pype/plugins/nuke/publish/extract_render_local.py +++ b/pype/plugins/nuke/publish/extract_render_local.py @@ -24,8 +24,8 @@ class NukeRenderLocal(pype.api.Extractor): self.log.debug("instance collected: {}".format(instance.data)) - first_frame = instance.data.get("startFrame", None) - last_frame = instance.data.get("endFrame", None) + first_frame = instance.data.get("frameStart", None) + last_frame = instance.data.get("frameEnd", None) node_subset_name = instance.data.get("name", None) self.log.info("Starting render") diff --git a/pype/plugins/nuke/publish/extract_review_data.py b/pype/plugins/nuke/publish/extract_review_data.py index f5a017321e..40c3e37434 100644 --- a/pype/plugins/nuke/publish/extract_review_data.py +++ b/pype/plugins/nuke/publish/extract_review_data.py @@ -67,8 +67,8 @@ class ExtractReviewData(pype.api.Extractor): else: fname = os.path.basename(instance.data.get("path", None)) fhead = os.path.splitext(fname)[0] + "." - first_frame = instance.data.get("startFrame", None) - last_frame = instance.data.get("endFrame", None) + first_frame = instance.data.get("frameStart", None) + last_frame = instance.data.get("frameEnd", None) node = previous_node = nuke.createNode("Read") @@ -149,8 +149,8 @@ class ExtractReviewData(pype.api.Extractor): 'ext': representation, 'files': file, "stagingDir": stagingDir, - "startFrame": first_frame, - "endFrame": last_frame, + "frameStart": first_frame, + "frameEnd": last_frame, "anatomy_template": "render", "tags": tags } diff --git a/pype/plugins/nuke/publish/submit_nuke_deadline.py b/pype/plugins/nuke/publish/submit_nuke_deadline.py index fb5d0fea75..33095700af 100644 --- a/pype/plugins/nuke/publish/submit_nuke_deadline.py +++ b/pype/plugins/nuke/publish/submit_nuke_deadline.py @@ -77,8 +77,8 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin): "Plugin": "Nuke", "Frames": "{start}-{end}".format( - start=int(instance.data["startFrame"]), - end=int(instance.data["endFrame"]) + start=int(instance.data["frameStart"]), + end=int(instance.data["frameEnd"]) ), "Comment": comment, @@ -199,7 +199,7 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin): def preflight_check(self, instance): """Ensure the startFrame, endFrame and byFrameStep are integers""" - for key in ("startFrame", "endFrame"): + for key in ("frameStart", "frameEnd"): value = instance.data[key] if int(value) == value: diff --git a/pype/plugins/nuke/publish/validate_rendered_frames.py b/pype/plugins/nuke/publish/validate_rendered_frames.py index 93eb84f304..9a10128871 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["endFrame"] - instance.data["startFrame"] + 1 + instance.data["frameEnd"] - instance.data["frameStart"] + 1 ) if frame_length != 1: diff --git a/pype/plugins/nuke/publish/validate_script.py b/pype/plugins/nuke/publish/validate_script.py index ae298de209..0043c957e9 100644 --- a/pype/plugins/nuke/publish/validate_script.py +++ b/pype/plugins/nuke/publish/validate_script.py @@ -24,22 +24,22 @@ class ValidateScript(pyblish.api.InstancePlugin): # These attributes will be checked attributes = [ "fps", - "fstart", - "fend", - "resolution_width", - "resolution_height", - "handle_start", - "handle_end" + "frameStart", + "frameEnd", + "resolutionWidth", + "resolutionHeight", + "handleStart", + "handleEnd" ] # Value of these attributes can be found on parents hierarchical_attributes = [ "fps", - "resolution_width", - "resolution_height", - "pixel_aspect", - "handle_start", - "handle_end" + "resolutionWidth", + "resolutionHeight", + "pixelAspect", + "handleStart", + "handleEnd" ] missing_attributes = [] @@ -72,25 +72,25 @@ class ValidateScript(pyblish.api.InstancePlugin): # Get handles from database, Default is 0 (if not found) handle_start = 0 handle_end = 0 - if "handle_start" in asset_attributes: - handle_start = asset_attributes["handle_start"] - if "handle_end" in asset_attributes: - handle_end = asset_attributes["handle_end"] + if "handleStart" in asset_attributes: + handle_start = asset_attributes["handleStart"] + if "handleEnd" in asset_attributes: + handle_end = asset_attributes["handleEnd"] # Set frame range with handles - # asset_attributes["fstart"] -= handle_start - # asset_attributes["fend"] += handle_end + # asset_attributes["frameStart"] -= handle_start + # asset_attributes["frameEnd"] += handle_end # Get values from nukescript script_attributes = { - "handle_start": ctx_data["handle_start"], - "handle_end": ctx_data["handle_end"], + "handleStart": ctx_data["handleStart"], + "handleEnd": ctx_data["handleEnd"], "fps": ctx_data["fps"], - "fstart": ctx_data["startFrame"], - "fend": ctx_data["endFrame"], - "resolution_width": ctx_data["resolution_width"], - "resolution_height": ctx_data["resolution_height"], - "pixel_aspect": ctx_data["pixel_aspect"] + "frameStart": ctx_data["frameStart"], + "frameEnd": ctx_data["frameEnd"], + "resolutionWidth": ctx_data["resolutionWidth"], + "resolutionHeight": ctx_data["resolutionHeight"], + "pixelAspect": ctx_data["pixelAspect"] } # Compare asset's values Nukescript X Database @@ -107,7 +107,7 @@ class ValidateScript(pyblish.api.InstancePlugin): msg = "Attributes '{}' are not set correctly" # Alert user that handles are set if Frame start/end not match if ( - (("fstart" in not_matching) or ("fend" in not_matching)) and + (("frameStart" in not_matching) or ("frameEnd" in not_matching)) and ((handle_start > 0) or (handle_end > 0)) ): msg += " (`handle_start` are set to {})".format(handle_start) diff --git a/pype/plugins/nukestudio/_unused/collect.py b/pype/plugins/nukestudio/_unused/collect.py deleted file mode 100644 index 4e20202fe0..0000000000 --- a/pype/plugins/nukestudio/_unused/collect.py +++ /dev/null @@ -1,191 +0,0 @@ -from pyblish import api - -class CollectFramerate(api.ContextPlugin): - """Collect framerate from selected sequence.""" - - order = api.CollectorOrder - label = "Collect Framerate" - hosts = ["nukestudio"] - - def process(self, context): - for item in context.data.get("selection", []): - context.data["framerate"] = item.sequence().framerate().toFloat() - return - - -class CollectTrackItems(api.ContextPlugin): - """Collect all tasks from submission.""" - - order = api.CollectorOrder - label = "Collect Track Items" - hosts = ["nukestudio"] - - def process(self, context): - import os - - submission = context.data.get("submission", None) - data = {} - - # Set handles - handles = 0 - if submission: - for task in submission.getLeafTasks(): - - if task._cutHandles: - handles = task._cutHandles - self.log.info("__ handles: '{}'".format(handles)) - - # Skip audio track items - media_type = "core.Hiero.Python.TrackItem.MediaType.kAudio" - if str(task._item.mediaType()) == media_type: - continue - - item = task._item - if item.name() not in data: - data[item.name()] = {"item": item, "tasks": [task]} - else: - data[item.name()]["tasks"].append(task) - - data[item.name()]["startFrame"] = task.outputRange()[0] - data[item.name()]["endFrame"] = task.outputRange()[1] - else: - for item in context.data.get("selection", []): - # Skip audio track items - # Try/Except is to handle items types, like EffectTrackItem - try: - media_type = "core.Hiero.Python.TrackItem.MediaType.kVideo" - if str(item.mediaType()) != media_type: - continue - except: - continue - - data[item.name()] = { - "item": item, - "tasks": [], - "startFrame": item.timelineIn(), - "endFrame": item.timelineOut() - } - - for key, value in data.items(): - - context.create_instance( - name=key, - subset="trackItem", - asset=value["item"].name(), - item=value["item"], - family="trackItem", - tasks=value["tasks"], - startFrame=value["startFrame"] + handles, - endFrame=value["endFrame"] - handles, - handles=handles - ) - context.create_instance( - name=key + "_review", - subset="reviewItem", - asset=value["item"].name(), - item=value["item"], - family="trackItem_review", - families=["output"], - handles=handles, - output_path=os.path.abspath( - os.path.join( - context.data["activeProject"].path(), - "..", - "workspace", - key + ".mov" - ) - ) - ) - - -class CollectTasks(api.ContextPlugin): - """Collect all tasks from submission.""" - - order = api.CollectorOrder + 0.01 - label = "Collect Tasks" - hosts = ["nukestudio"] - - def process(self, context): - import os - import re - - import hiero.exporters as he - import clique - - for parent in context: - if "trackItem" != parent.data["family"]: - continue - - for task in parent.data["tasks"]: - asset_type = None - - hiero_cls = he.FnSymLinkExporter.SymLinkExporter - if isinstance(task, hiero_cls): - asset_type = "img" - movie_formats = [".mov", ".R3D"] - ext = os.path.splitext(task.resolvedExportPath())[1] - if ext in movie_formats: - asset_type = "mov" - - hiero_cls = he.FnTranscodeExporter.TranscodeExporter - if isinstance(task, hiero_cls): - asset_type = "img" - if task.resolvedExportPath().endswith(".mov"): - asset_type = "mov" - - hiero_cls = he.FnNukeShotExporter.NukeShotExporter - if isinstance(task, hiero_cls): - asset_type = "scene" - - hiero_cls = he.FnAudioExportTask.AudioExportTask - if isinstance(task, hiero_cls): - asset_type = "audio" - - # Skip all non supported export types - if not asset_type: - continue - - resolved_path = task.resolvedExportPath() - - # Formatting the basename to not include frame padding or - # extension. - name = os.path.splitext(os.path.basename(resolved_path))[0] - name = name.replace(".", "") - name = name.replace("#", "") - name = re.sub(r"%.*d", "", name) - instance = context.create_instance(name=name, parent=parent) - - instance.data["task"] = task - instance.data["item"] = parent.data["item"] - - instance.data["family"] = "trackItem.task" - instance.data["families"] = [asset_type, "local", "task"] - - label = "{1}/{0} - {2} - local".format( - name, parent, asset_type - ) - instance.data["label"] = label - - instance.data["handles"] = parent.data["handles"] - - # Add collection or output - if asset_type == "img": - collection = None - - if "#" in resolved_path: - head = resolved_path.split("#")[0] - padding = resolved_path.count("#") - tail = resolved_path.split("#")[-1] - - collection = clique.Collection( - head=head, padding=padding, tail=tail - ) - - if "%" in resolved_path: - collection = clique.parse( - resolved_path, pattern="{head}{padding}{tail}" - ) - - instance.data["collection"] = collection - else: - instance.data["output_path"] = resolved_path diff --git a/pype/plugins/nukestudio/_unused/collect_plates.py b/pype/plugins/nukestudio/_unused/collect_plates.py deleted file mode 100644 index 6dbd27dc59..0000000000 --- a/pype/plugins/nukestudio/_unused/collect_plates.py +++ /dev/null @@ -1,215 +0,0 @@ -from pyblish import api -import pype - - -class CollectPlates(api.InstancePlugin): - """Collect plates""" - - order = api.CollectorOrder + 0.49 - label = "Collect Plates" - hosts = ["nukestudio"] - families = ["plate"] - - def process(self, instance): - import os - - # add to representations - if not instance.data.get("representations"): - instance.data["representations"] = list() - - version_data = dict() - context = instance.context - anatomy = context.data.get("anatomy", None) - padding = int(anatomy.templates['render']['padding']) - - name = instance.data["subset"] - asset = instance.data["asset"] - track = instance.data["track"] - family = instance.data["family"] - families = instance.data["families"] - version = instance.data["version"] - source_path = instance.data["sourcePath"] - source_file = os.path.basename(source_path) - - # staging dir creation - staging_dir = os.path.dirname( - source_path) - - item = instance.data["item"] - - # get handles - handles = int(instance.data["handles"]) - handle_start = int(instance.data["handleStart"]) - handle_end = int(instance.data["handleEnd"]) - - # get source frames - source_in = int(instance.data["sourceIn"]) - source_out = int(instance.data["sourceOut"]) - - # get source frames - frame_start = int(instance.data["startFrame"]) - frame_end = int(instance.data["endFrame"]) - - # get source frames - source_in_h = int(instance.data["sourceInH"]) - source_out_h = int(instance.data["sourceOutH"]) - - # get timeline frames - timeline_in = int(instance.data["timelineIn"]) - timeline_out = int(instance.data["timelineOut"]) - - # frame-ranges with handles - timeline_frame_start = int(instance.data["timelineInHandles"]) - timeline_frame_end = int(instance.data["timelineOutHandles"]) - - # get colorspace - colorspace = item.sourceMediaColourTransform() - - # get sequence from context, and fps - fps = float(str(instance.data["fps"])) - - # test output - self.log.debug("__ handles: {}".format(handles)) - self.log.debug("__ handle_start: {}".format(handle_start)) - self.log.debug("__ handle_end: {}".format(handle_end)) - self.log.debug("__ frame_start: {}".format(frame_start)) - self.log.debug("__ frame_end: {}".format(frame_end)) - self.log.debug("__ f duration: {}".format(frame_end - frame_start + 1)) - self.log.debug("__ source_in: {}".format(source_in)) - self.log.debug("__ source_out: {}".format(source_out)) - self.log.debug("__ s duration: {}".format(source_out - source_in + 1)) - self.log.debug("__ source_in_h: {}".format(source_in_h)) - self.log.debug("__ source_out_h: {}".format(source_out_h)) - self.log.debug("__ sh duration: {}".format(source_out_h - source_in_h + 1)) - self.log.debug("__ timeline_in: {}".format(timeline_in)) - self.log.debug("__ timeline_out: {}".format(timeline_out)) - self.log.debug("__ t duration: {}".format(timeline_out - timeline_in + 1)) - self.log.debug("__ timeline_frame_start: {}".format( - timeline_frame_start)) - self.log.debug("__ timeline_frame_end: {}".format(timeline_frame_end)) - self.log.debug("__ colorspace: {}".format(colorspace)) - self.log.debug("__ track: {}".format(track)) - self.log.debug("__ fps: {}".format(fps)) - self.log.debug("__ source_file: {}".format(source_file)) - self.log.debug("__ staging_dir: {}".format(staging_dir)) - - self.log.debug("__ before family: {}".format(family)) - self.log.debug("__ before families: {}".format(families)) - # - # this is just workaround because 'clip' family is filtered - instance.data["family"] = families[-1] - instance.data["families"].append(family) - - # add to data of representation - version_data.update({ - "handles": handles, - "handleStart": handle_start, - "handleEnd": handle_end, - "sourceIn": source_in, - "sourceOut": source_out, - "startFrame": frame_start, - "endFrame": frame_end, - "timelineIn": timeline_in, - "timelineOut": timeline_out, - "timelineInHandles": timeline_frame_start, - "timelineOutHandles": timeline_frame_end, - "fps": fps, - "colorspace": colorspace, - "families": [f for f in families if 'ftrack' not in f], - "asset": asset, - "subset": name, - "track": track, - "version": int(version) - }) - instance.data["versionData"] = version_data - - try: - basename, ext = os.path.splitext(source_file) - head, padding = os.path.splitext(basename) - ext = ext[1:] - padding = padding[1:] - # head, padding, ext = source_file.split('.') - source_first_frame = int(padding) - padding = len(padding) - file = "{head}.%0{padding}d.{ext}".format( - head=head, - padding=padding, - ext=ext - ) - start_frame = source_first_frame - end_frame = source_first_frame + source_out - files = [file % i for i in range( - (source_first_frame + source_in_h), - ((source_first_frame + source_out_h) + 1), 1)] - except Exception as e: - self.log.debug("Exception in file: {}".format(e)) - head, ext = os.path.splitext(source_file) - ext = ext[1:] - files = source_file - start_frame = source_in_h - end_frame = source_out_h - - - mov_file = head + ".mov" - mov_path = os.path.normpath(os.path.join(staging_dir, mov_file)) - if os.path.exists(mov_path): - # adding mov into the representations - self.log.debug("__ mov_path: {}".format(mov_path)) - plates_mov_representation = { - 'files': mov_file, - 'stagingDir': staging_dir, - 'startFrame': 0, - 'endFrame': source_out - source_in + 1, - 'step': 1, - 'frameRate': fps, - 'preview': True, - 'thumbnail': False, - 'name': "preview", - 'ext': "mov", - } - instance.data["representations"].append( - plates_mov_representation) - - thumb_file = head + ".png" - thumb_path = os.path.join(staging_dir, thumb_file) - self.log.debug("__ thumb_path: {}".format(thumb_path)) - thumbnail = item.thumbnail(source_in).save( - thumb_path, - format='png' - ) - self.log.debug("__ thumbnail: {}".format(thumbnail)) - - thumb_representation = { - 'files': thumb_file, - 'stagingDir': staging_dir, - 'name': "thumbnail", - 'thumbnail': True, - 'ext': "png" - } - instance.data["representations"].append( - thumb_representation) - - # adding representation for plates - plates_representation = { - 'files': files, - 'stagingDir': staging_dir, - 'name': ext, - 'ext': ext, - 'startFrame': start_frame, - 'endFrame': end_frame, - } - instance.data["representations"].append(plates_representation) - - # testing families - family = instance.data["family"] - families = instance.data["families"] - - # test prints version_data - self.log.debug("__ version_data: {}".format(version_data)) - self.log.debug("__ plates_representation: {}".format( - plates_representation)) - self.log.debug("__ after family: {}".format(family)) - self.log.debug("__ after families: {}".format(families)) - - # # this will do FnNsFrameServer - # FnNsFrameServer.renderFrames(*_args) diff --git a/pype/plugins/nukestudio/_unused/extract_plate.py b/pype/plugins/nukestudio/_unused/extract_plate.py deleted file mode 100644 index acd7f056ba..0000000000 --- a/pype/plugins/nukestudio/_unused/extract_plate.py +++ /dev/null @@ -1,140 +0,0 @@ -import os -import subprocess - -from hiero.exporters.FnExportUtil import writeSequenceAudioWithHandles - -import pype.api -from pype.vendor import ffmpeg - - -class ExtractPlate(pype.api.Extractor): - """Extract plate cut to the timeline. - - Only supporting mov plates for now. Image sequences already get cut down to - timeline range. - - """ - - label = "Plate" - hosts = ["nukestudio"] - families = ["plate"] - optional = True - - def process(self, instance): - if not instance.data["sourcePath"].endswith(".mov"): - self.log.debug( - "Skipping {} because its not a \"*.mov\" " - "format.".format(instance) - ) - return - - staging_dir = self.staging_dir(instance) - filename = "{0}_without_sound".format(instance.name) + ".mov" - output_path = os.path.join(staging_dir, filename) - input_path = instance.data["sourcePath"] - - self.log.info("Outputting movie to %s" % output_path) - - # Cut plate to timeline. - item = instance.data["item"] - start_frame = item.mapTimelineToSource( - item.timelineIn() - ( - instance.data["handleStart"] - ) - ) - end_frame = item.mapTimelineToSource( - item.timelineOut() + ( - instance.data["handleEnd"] - ) - ) - framerate = item.sequence().framerate().toFloat() - output_options = { - "vcodec": "copy", - "ss": start_frame / framerate, - "frames": int(end_frame - start_frame) + 1 - } - - try: - ( - ffmpeg - .input(input_path) - .output(output_path, **output_options) - .run(overwrite_output=True, - capture_stdout=True, - capture_stderr=True) - ) - except ffmpeg.Error as e: - ffmpeg_error = "ffmpeg error: {}".format(e.stderr) - self.log.error(ffmpeg_error) - raise RuntimeError(ffmpeg_error) - - # Extract audio. - filename = "{0}".format(instance.name) + ".wav" - audio_path = os.path.join(staging_dir, filename) - writeSequenceAudioWithHandles( - audio_path, - item.sequence(), - item.timelineIn(), - item.timelineOut(), - 0, - 0 - ) - - input_path = output_path - filename = "{0}_with_sound".format(instance.name) + ".mov" - output_path = os.path.join(staging_dir, filename) - - args = [ - "ffmpeg", - "-i", input_path, - "-i", audio_path, - "-vcodec", "copy", - output_path - ] - - self.log.debug(subprocess.list2cmdline(args)) - p = subprocess.Popen( - args, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - stdin=subprocess.PIPE, - cwd=os.path.dirname(args[-1]) - ) - - output = p.communicate()[0] - - if p.returncode != 0: - raise ValueError(output) - - self.log.debug(output) - - # Adding representation. - ext = os.path.splitext(output_path)[1][1:] - representation = { - "files": os.path.basename(output_path), - "staging_dir": staging_dir, - "startFrame": 0, - "endFrame": end_frame - start_frame, - "step": 1, - "frameRate": framerate, - "thumbnail": False, - "name": ext, - "ext": ext - } - instance.data["representations"] = [representation] - self.log.debug("Adding representation: {}".format(representation)) - - # Adding thumbnail representation. - path = instance.data["sourcePath"].replace(".mov", ".png") - if not os.path.exists(path): - item.thumbnail(start_frame).save(path, format="png") - - representation = { - "files": os.path.basename(path), - "stagingDir": os.path.dirname(path), - "name": "thumbnail", - "thumbnail": True, - "ext": "png" - } - instance.data["representations"].append(representation) - self.log.debug("Adding representation: {}".format(representation)) diff --git a/pype/plugins/nukestudio/_unused/extract_plates.py b/pype/plugins/nukestudio/_unused/extract_plates.py deleted file mode 100644 index 6bf6019adb..0000000000 --- a/pype/plugins/nukestudio/_unused/extract_plates.py +++ /dev/null @@ -1,238 +0,0 @@ -from pyblish import api -import pype - - -class ExtractPlates(pype.api.Extractor): - """Extracts plates""" - - order = api.ExtractorOrder - label = "Extract Plates" - hosts = ["nukestudio"] - families = ["encode"] - - def process(self, instance): - import os - import hiero.core - # from hiero.ui.nuke_bridge import FnNsFrameServer - - # add to representations - if not instance.data.get("representations"): - instance.data["representations"] = list() - - version_data = dict() - context = instance.context - anatomy = context.data.get("anatomy", None) - padding = int(anatomy.templates['render']['padding']) - - name = instance.data["subset"] - asset = instance.data["asset"] - track = instance.data["track"] - family = instance.data["family"] - families = instance.data["families"] - attrs = instance.data["attributes"] - version = instance.data["version"] - - # staging dir creation - self.log.debug("creating staging dir") - self.staging_dir(instance) - - staging_dir = instance.data['stagingDir'] - - Nuke_writer = hiero.core.nuke.ScriptWriter() - - item = instance.data["item"] - - # get handles - handles = int(instance.data["handles"]) - handle_start = int(instance.data["handleStart"]) - handle_end = int(instance.data["handleEnd"]) - - # get timeline frames - timeline_in = int(instance.data["timelineIn"]) - timeline_out = int(instance.data["timelineOut"]) - - # frame-ranges with handles - timeline_frame_start = int(instance.data["timelineInHandles"]) - timeline_frame_end = int(instance.data["timelineOutHandles"]) - - # creating comp frame range - frame_start = int(instance.data["startFrame"]) - frame_end = int(instance.data["endFrame"]) - - # get colorspace - colorspace = instance.context.data["colorspace"] - - # get sequence from context, and fps - fps = int(instance.data["fps"]) - - # test output - self.log.debug("__ handles: {}".format(handles)) - self.log.debug("__ handle_start: {}".format(handle_start)) - self.log.debug("__ handle_end: {}".format(handle_end)) - self.log.debug("__ timeline_in: {}".format(timeline_in)) - self.log.debug("__ timeline_out: {}".format(timeline_out)) - self.log.debug("__ timeline_frame_start: {}".format( - timeline_frame_start)) - self.log.debug("__ timeline_frame_end: {}".format(timeline_frame_end)) - self.log.debug("__ frame_start: {}".format(frame_start)) - self.log.debug("__ frame_end: {}".format(frame_end)) - self.log.debug("__ colorspace: {}".format(colorspace)) - self.log.debug("__ track: {}".format(track)) - self.log.debug("__ fps: {}".format(fps)) - - # Generate Nuke script - write_name = "Write_out" - - # root node - root_node = hiero.core.nuke.RootNode( - frame_start, - frame_end, - fps=fps - ) - - root_node.addProjectSettings(colorspace) - - # create write node and link it to root node - Nuke_writer.addNode(root_node) - '''TrackItem.addToNukeScript(script=, firstFrame=None, additionalNodes=[], additionalNodesCallback=None, includeRetimes=False, retimeMethod=None, startHandle=None, endHandle=None, colourTransform=None, offset=0, nodeLabel=None, includeAnnotations=False, includeEffects=True, outputToSequenceFormat=False)''' - item.addToNukeScript( - script=Nuke_writer, - firstFrame=frame_start, - includeRetimes=attrs["includeRetimes"], - retimeMethod=attrs["retimeMethod"], - startHandle=handle_start, - endHandle=handle_end, - includeEffects=attrs["includeEffects"], - includeAnnotations=attrs["includeAnnotations"] - ) - - write_knobs = attrs["nodes"]["write"]["attributes"] - - # TODO: take template from anatomy - nukescript_file = "{asset}_{name}_v{version}.{ext}".format( - asset=asset, - name=name, - version=version, - ext="nk" - ) - nukescript_path = os.path.join( - staging_dir, nukescript_file - ) - - # TODO: take template from anatomy - output_file = "{asset}_{name}_v{version}.%0{padding}d.{ext}".format( - asset=asset, - name=name, - version=version, - padding=padding, - ext=write_knobs["file_type"] - ) - output_path = os.path.join( - staging_dir, output_file - ) - - write_node = hiero.core.nuke.WriteNode(output_path.replace("\\", "/")) - write_node.setKnob("name", write_name) - write_node.setKnob("file_type", write_knobs["file_type"]) - for knob, value in write_knobs.items(): - write_node.setKnob(knob, value) - - Nuke_writer.addNode(write_node) - - Nuke_writer.writeToDisk(nukescript_path) - - # test prints - self.log.debug("__ output_file: {}".format(output_file)) - self.log.debug("__ output_path: {}".format(output_path)) - self.log.debug("__ nukescript_file: {}".format(nukescript_file)) - self.log.debug("__ nukescript_path: {}".format(nukescript_path)) - self.log.debug("__ write_knobs: {}".format(write_knobs)) - self.log.debug("__ write_name: {}".format(write_name)) - self.log.debug("__ Nuke_writer: {}".format(Nuke_writer)) - - # create rendering arguments for FnNsFrameServer - _args = [ - nukescript_path, - "{}-{}".format(frame_start, frame_end), - write_name, - ["main"] - ] - - # add to data of representation - version_data.update({ - "handles": handles, - "handleStart": handle_start, - "handleEnd": handle_end, - "timelineIn": timeline_in, - "timelineOut": timeline_out, - "timelineInHandles": timeline_frame_start, - "timelineOutHandles": timeline_frame_end, - "compFrameIn": frame_start, - "compFrameOut": frame_end, - "fps": fps, - "colorspace": write_knobs["colorspace"], - "nukeScriptFileName": nukescript_file, - "nukeWriteFileName": output_file, - "nukeWriteName": write_name, - "FnNsFrameServer_renderFrames_args": str(_args), - "family": family, - "families": families, - "asset": asset, - "subset": name, - "track": track, - "version": int(version) - }) - instance.data["versionData"] = version_data - - # adding representation for nukescript - nk_representation = { - 'files': nukescript_file, - 'stagingDir': staging_dir, - 'name': "nk", - 'ext': "nk", - } - instance.data["representations"].append(nk_representation) - - # adding representation for plates - plates_representation = { - 'files': [output_file % i for i in range( - frame_start, (frame_end + 1), 1)], - 'stagingDir': staging_dir, - 'name': write_knobs["file_type"], - 'ext': write_knobs["file_type"], - } - instance.data["representations"].append(plates_representation) - - # adding checking file to context for ExtractPlateCheck(context) plugin - context.data["platesCheck"] = os.path.join( - staging_dir, output_file % frame_end - ) - - if not context.data.get("frameServerRenderQueue"): - context.data["frameServerRenderQueue"] = list() - - # add to render queue list - context.data["frameServerRenderQueue"].append(_args) - - # test prints - self.log.debug("__ before family: {}".format(family)) - self.log.debug("__ before families: {}".format(families)) - - # this is just workaround because 'clip' family is filtered - instance.data["family"] = families[-1] - instance.data["families"].append(family) - - # testing families - family = instance.data["family"] - families = instance.data["families"] - - # test prints version_data - self.log.debug("__ version_data: {}".format(version_data)) - self.log.debug("__ nk_representation: {}".format(nk_representation)) - self.log.debug("__ plates_representation: {}".format( - plates_representation)) - self.log.debug("__ after family: {}".format(family)) - self.log.debug("__ after families: {}".format(families)) - - # # this will do FnNsFrameServer - # FnNsFrameServer.renderFrames(*_args) diff --git a/pype/plugins/nukestudio/_unused/extract_review.py b/pype/plugins/nukestudio/_unused/extract_review.py deleted file mode 100644 index 13ef3484aa..0000000000 --- a/pype/plugins/nukestudio/_unused/extract_review.py +++ /dev/null @@ -1,138 +0,0 @@ -import os -import subprocess - -from hiero.exporters.FnExportUtil import writeSequenceAudioWithHandles - -import pype.api - - -class ExtractReview(pype.api.Extractor): - """Extract Quicktime with optimized codec for reviewing.""" - - label = "Review" - hosts = ["nukestudio"] - families = ["review"] - optional = True - - def process(self, instance): - staging_dir = self.staging_dir(instance) - filename = "{0}_without_sound".format(instance.name) + ".mov" - output_path = os.path.join(staging_dir, filename) - input_path = instance.data["sourcePath"] - item = instance.data["item"] - - # Has to be yuv420p for compatibility with older players and smooth - # playback. This does come with a sacrifice of more visible banding - # issues. - start_frame = item.mapTimelineToSource(item.timelineIn()) - end_frame = item.mapTimelineToSource(item.timelineOut()) - args = [ - "ffmpeg", - "-ss", str(start_frame / item.sequence().framerate().toFloat()), - "-i", input_path, - "-pix_fmt", "yuv420p", - "-crf", "18", - "-timecode", "00:00:00:01", - "-vf", "scale=trunc(iw/2)*2:trunc(ih/2)*2", - "-frames", str(int(end_frame - start_frame) + 1), - output_path - ] - - self.log.debug(subprocess.list2cmdline(args)) - p = subprocess.Popen( - args, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - stdin=subprocess.PIPE, - cwd=os.path.dirname(args[-1]) - ) - - output = p.communicate()[0] - - if p.returncode != 0: - raise ValueError(output) - - self.log.debug(output) - - # Extract audio. - filename = "{0}".format(instance.name) + ".wav" - audio_path = os.path.join(staging_dir, filename) - writeSequenceAudioWithHandles( - audio_path, - item.sequence(), - item.timelineIn(), - item.timelineOut(), - 0, - 0 - ) - - input_path = output_path - filename = "{0}_with_sound".format(instance.name) + ".mov" - output_path = os.path.join(staging_dir, filename) - - args = [ - "ffmpeg", - "-i", input_path, - "-i", audio_path, - "-vcodec", "copy", - output_path - ] - - self.log.debug(subprocess.list2cmdline(args)) - p = subprocess.Popen( - args, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - stdin=subprocess.PIPE, - cwd=os.path.dirname(args[-1]) - ) - - output = p.communicate()[0] - - if p.returncode != 0: - raise ValueError(output) - - self.log.debug(output) - - # Adding movie representation. - start_frame = int( - instance.data["sourceIn"] - ( - instance.data["handleStart"] - ) - ) - end_frame = int( - instance.data["sourceOut"] + ( - instance.data["handleEnd"] - ) - ) - representation = { - "files": os.path.basename(output_path), - "staging_dir": staging_dir, - "startFrame": 0, - "endFrame": end_frame - start_frame, - "step": 1, - "frameRate": ( - instance.context.data["activeSequence"].framerate().toFloat() - ), - "preview": True, - "thumbnail": False, - "name": "preview", - "ext": "mov", - } - instance.data["representations"] = [representation] - self.log.debug("Adding representation: {}".format(representation)) - - # Adding thumbnail representation. - path = instance.data["sourcePath"].replace(".mov", ".png") - if not os.path.exists(path): - item.thumbnail(start_frame).save(path, format="png") - - representation = { - "files": os.path.basename(path), - "stagingDir": os.path.dirname(path), - "name": "thumbnail", - "thumbnail": True, - "ext": "png" - } - instance.data["representations"].append(representation) - self.log.debug("Adding representation: {}".format(representation)) diff --git a/pype/plugins/nukestudio/publish/collect_clips.py b/pype/plugins/nukestudio/publish/collect_clips.py index 952838e590..da71e2ab50 100644 --- a/pype/plugins/nukestudio/publish/collect_clips.py +++ b/pype/plugins/nukestudio/publish/collect_clips.py @@ -78,8 +78,8 @@ class CollectClips(api.ContextPlugin): "sourceFirst": source_first_frame, "sourceIn": int(item.sourceIn()), "sourceOut": int(item.sourceOut()), - "timelineIn": int(item.timelineIn()), - "timelineOut": int(item.timelineOut()) + "clipIn": int(item.timelineIn()), + "clipOut": int(item.timelineOut()) } ) diff --git a/pype/plugins/nukestudio/publish/collect_frame_ranges.py b/pype/plugins/nukestudio/publish/collect_frame_ranges.py index 22b99a9ed4..392dbba68b 100644 --- a/pype/plugins/nukestudio/publish/collect_frame_ranges.py +++ b/pype/plugins/nukestudio/publish/collect_frame_ranges.py @@ -18,14 +18,14 @@ class CollectClipFrameRanges(pyblish.api.InstancePlugin): source_in_h = instance.data["sourceIn"] - handle_start source_out_h = instance.data["sourceOut"] + handle_end - timeline_in = instance.data["timelineIn"] - timeline_out = instance.data["timelineOut"] + timeline_in = instance.data["clipIn"] + timeline_out = instance.data["clipOut"] timeline_in_h = timeline_in - handle_start timeline_out_h = timeline_out + handle_end # set frame start with tag or take it from timeline - frame_start = instance.data.get("frameStart") + frame_start = instance.data.get("startingFrame") if not frame_start: frame_start = timeline_in @@ -36,12 +36,10 @@ class CollectClipFrameRanges(pyblish.api.InstancePlugin): { "sourceInH": source_in_h, "sourceOutH": source_out_h, - "startFrame": frame_start, - "endFrame": frame_end, - "timelineInH": timeline_in_h, - "timelineOutH": timeline_out_h, - "edit_in": timeline_in, - "edit_out": timeline_out + "frameStart": frame_start, + "frameEnd": frame_end, + "clipInH": timeline_in_h, + "clipOutH": timeline_out_h } ) self.log.debug("__ data: {}".format(data)) diff --git a/pype/plugins/nukestudio/publish/collect_handles.py b/pype/plugins/nukestudio/publish/collect_handles.py index ed13691daf..8da83e715b 100644 --- a/pype/plugins/nukestudio/publish/collect_handles.py +++ b/pype/plugins/nukestudio/publish/collect_handles.py @@ -1,4 +1,3 @@ -import json from pyblish import api @@ -56,6 +55,8 @@ class CollectClipHandles(api.ContextPlugin): "handleStart", 0 ) instance.data["handleEnd"] = s_asset_data.get("handleEnd", 0) + + # debug printing self.log.debug("_ s_asset_data: `{}`".format( s_asset_data)) self.log.debug("_ instance.data[handles]: `{}`".format( diff --git a/pype/plugins/nukestudio/publish/collect_hierarchy_context.py b/pype/plugins/nukestudio/publish/collect_hierarchy_context.py index 92149b7fc8..474cdfaa19 100644 --- a/pype/plugins/nukestudio/publish/collect_hierarchy_context.py +++ b/pype/plugins/nukestudio/publish/collect_hierarchy_context.py @@ -161,10 +161,10 @@ class CollectHierarchyInstance(pyblish.api.ContextPlugin): }) # adding frame start if any on instance - start_frame = instance.data.get("frameStart") + start_frame = instance.data.get("startingFrame") if start_frame: asset_shared.update({ - "frameStart": start_frame + "startingFrame": start_frame }) @@ -218,12 +218,12 @@ class CollectHierarchyContext(pyblish.api.ContextPlugin): instance.data["tasks"] = s_asset_data["tasks"] # adding frame start if any on instance - start_frame = s_asset_data.get("frameStart") + start_frame = s_asset_data.get("startingFrame") if start_frame: - instance.data["startFrame"] = start_frame - instance.data["endFrame"] = start_frame + ( - instance.data["timelineOut"] - - instance.data["timelineIn"]) + instance.data["frameStart"] = start_frame + instance.data["frameEnd"] = start_frame + ( + instance.data["clipOut"] - + instance.data["clipIn"]) @@ -254,13 +254,11 @@ class CollectHierarchyContext(pyblish.api.ContextPlugin): if instance.data.get("main"): in_info['custom_attributes'] = { 'handles': int(instance.data.get('handles', 0)), - 'handle_start': handle_start, - 'handle_end': handle_end, - 'fstart': instance.data["startFrame"], - 'fend': instance.data["endFrame"], - 'fps': instance.context.data["fps"], - "edit_in": instance.data["timelineIn"], - "edit_out": instance.data["timelineOut"] + "handleStart": handle_start, + "handleEnd": handle_end, + "frameStart": instance.data["frameStart"], + "frameEnd": instance.data["frameEnd"], + 'fps': instance.context.data["fps"] } # adding SourceResolution if Tag was present @@ -272,9 +270,9 @@ class CollectHierarchyContext(pyblish.api.ContextPlugin): width, height, pixel_aspect)) in_info['custom_attributes'].update({ - "resolution_width": width, - "resolution_height": height, - "pixel_aspect": pixel_aspect + "resolutionWidth": width, + "resolutionHeight": height, + "pixelAspect": pixel_aspect }) in_info['tasks'] = instance.data['tasks'] diff --git a/pype/plugins/nukestudio/publish/collect_plates.py b/pype/plugins/nukestudio/publish/collect_plates.py index 0341fbfa6e..c9e6305062 100644 --- a/pype/plugins/nukestudio/publish/collect_plates.py +++ b/pype/plugins/nukestudio/publish/collect_plates.py @@ -54,7 +54,8 @@ class CollectPlates(api.InstancePlugin): data["name"] = data["subset"] + "_" + data["asset"] data["label"] = "{} - {} - ({})".format( - data['asset'], data["subset"], os.path.splitext(data["sourcePath"])[1] + data['asset'], data["subset"], os.path.splitext(data["sourcePath"])[ + 1] ) if "review" in instance.data["families"]: @@ -120,7 +121,9 @@ class CollectPlatesData(api.InstancePlugin): item = instance.data["item"] transfer_data = [ - "handleStart", "handleEnd", "sourceIn", "sourceOut", "startFrame", "endFrame", "sourceInH", "sourceOutH", "timelineIn", "timelineOut", "timelineInH", "timelineOutH", "asset", "track", "version" + "handleStart", "handleEnd", "sourceIn", "sourceOut", "frameStart", + "frameEnd", "sourceInH", "sourceOutH", "clipIn", "clipOut", + "clipInH", "clipOutH", "asset", "track", "version" ] # pass data to version @@ -170,10 +173,10 @@ class CollectPlatesData(api.InstancePlugin): plates_mov_representation = { 'files': mov_file, 'stagingDir': staging_dir, - 'startFrame': 0, - 'endFrame': instance.data["sourceOut"] - instance.data["sourceIn"] + 1, + "frameStart": 0, + "frameEnd": instance.data["sourceOut"] - instance.data["sourceIn"] + 1, 'step': 1, - 'frameRate': instance.context.data["fps"], + 'fps': instance.context.data["fps"], 'preview': True, 'thumbnail': False, 'name': "preview", @@ -209,8 +212,8 @@ class CollectPlatesData(api.InstancePlugin): 'stagingDir': staging_dir, 'name': ext, 'ext': ext, - 'startFrame': instance.data["startFrame"] - instance.data["handleStart"], - 'endFrame': instance.data["endFrame"] + instance.data["handleEnd"], + "frameStart": instance.data["frameStart"] - instance.data["handleStart"], + "frameEnd": instance.data["frameEnd"] + instance.data["handleEnd"], } instance.data["representations"].append(plates_representation) diff --git a/pype/plugins/nukestudio/publish/collect_reviews.py b/pype/plugins/nukestudio/publish/collect_reviews.py index 84b98b9445..9fab0f0741 100644 --- a/pype/plugins/nukestudio/publish/collect_reviews.py +++ b/pype/plugins/nukestudio/publish/collect_reviews.py @@ -91,10 +91,10 @@ class CollectReviews(api.InstancePlugin): representation = { "files": file, "stagingDir": file_dir, - "startFrame": rev_inst.data.get("sourceIn"), - "endFrame": rev_inst.data.get("sourceOut"), + "frameStart": rev_inst.data.get("sourceIn"), + "frameEnd": rev_inst.data.get("sourceOut"), "step": 1, - "frameRate": rev_inst.data.get("fps"), + "fps": rev_inst.data.get("fps"), "preview": True, "thumbnail": False, "name": "preview", @@ -140,7 +140,7 @@ class CollectReviews(api.InstancePlugin): item = instance.data["item"] transfer_data = [ - "handleStart", "handleEnd", "sourceIn", "sourceOut", "startFrame", "endFrame", "sourceInH", "sourceOutH", "timelineIn", "timelineOut", "timelineInH", "timelineOutH", "asset", "track", "version" + "handleStart", "handleEnd", "sourceIn", "sourceOut", "frameStart", "frameEnd", "sourceInH", "sourceOutH", "clipIn", "clipOut", "clipInH", "clipOutH", "asset", "track", "version" ] version_data = dict() diff --git a/pype/plugins/nukestudio/publish/collect_tag_framestart.py b/pype/plugins/nukestudio/publish/collect_tag_framestart.py index 256350b2a4..3ab7979aa7 100644 --- a/pype/plugins/nukestudio/publish/collect_tag_framestart.py +++ b/pype/plugins/nukestudio/publish/collect_tag_framestart.py @@ -18,7 +18,7 @@ class CollectClipTagFrameStart(api.InstancePlugin): t_family = t_metadata.get("tag.family", "") # gets only task family tags and collect labels - if "frameStart" in t_family: + if "startingFrame" in t_family: t_number = t_metadata.get("tag.number", "") start_frame = int(t_number) - instance.data["frameStart"] = start_frame + instance.data["startingFrame"] = start_frame diff --git a/pype/scripts/fusion_switch_shot.py b/pype/scripts/fusion_switch_shot.py index 92271a3b7c..26a93b9b9a 100644 --- a/pype/scripts/fusion_switch_shot.py +++ b/pype/scripts/fusion_switch_shot.py @@ -138,8 +138,8 @@ def update_frame_range(comp, representations): versions = io.find({"type": "version", "_id": {"$in": version_ids}}) versions = list(versions) - start = min(v["data"]["startFrame"] for v in versions) - end = max(v["data"]["endFrame"] for v in versions) + start = min(v["data"]["frameStart"] for v in versions) + end = max(v["data"]["frameEnd"] for v in versions) fusion_lib.update_frame_range(start, end, comp=comp) diff --git a/pype/standalonepublish/widgets/widget_component_item.py b/pype/standalonepublish/widgets/widget_component_item.py index a58a292ec5..9631fed258 100644 --- a/pype/standalonepublish/widgets/widget_component_item.py +++ b/pype/standalonepublish/widgets/widget_component_item.py @@ -301,11 +301,11 @@ class ComponentItem(QtWidgets.QFrame): 'preview': self.is_preview() } - if ('startFrame' in self.in_data and 'endFrame' in self.in_data): - data['startFrame'] = self.in_data['startFrame'] - data['endFrame'] = self.in_data['endFrame'] + if ("frameStart" in self.in_data and "frameEnd" in self.in_data): + data["frameStart"] = self.in_data["frameStart"] + data["frameEnd"] = self.in_data["frameEnd"] - if 'frameRate' in self.in_data: - data['frameRate'] = self.in_data['frameRate'] + if 'fps' in self.in_data: + data['fps'] = self.in_data['fps'] return data diff --git a/pype/standalonepublish/widgets/widget_drop_frame.py b/pype/standalonepublish/widgets/widget_drop_frame.py index c792813a22..e60db892db 100644 --- a/pype/standalonepublish/widgets/widget_drop_frame.py +++ b/pype/standalonepublish/widgets/widget_drop_frame.py @@ -185,8 +185,8 @@ class DropDataFrame(QtWidgets.QFrame): 'name': file_base, 'ext': file_ext, 'file_info': range, - 'startFrame': startFrame, - 'endFrame': endFrame, + "frameStart": startFrame, + "frameEnd": endFrame, 'representation': repr_name, 'folder_path': folder_path, 'is_sequence': True, @@ -253,24 +253,24 @@ class DropDataFrame(QtWidgets.QFrame): ext in self.presets['extensions']['video_file'] ): probe_data = self.load_data_with_probe(filepath) - if 'frameRate' not in data: + if 'fps' not in data: # default value - frameRate = 25 - frameRate_string = probe_data.get('r_frame_rate') - if frameRate_string: - frameRate = int(frameRate_string.split('/')[0]) + fps = 25 + fps_string = probe_data.get('r_frame_rate') + if fps_string: + fps = int(fps_string.split('/')[0]) - output['frameRate'] = frameRate + output['fps'] = fps - if 'startFrame' not in data or 'endFrame' not in data: + if "frameStart" not in data or "frameEnd" not in data: startFrame = endFrame = 1 endFrame_string = probe_data.get('nb_frames') if endFrame_string: endFrame = int(endFrame_string) - output['startFrame'] = startFrame - output['endFrame'] = endFrame + output["frameStart"] = startFrame + output["frameEnd"] = endFrame if (ext == '.mov') and (not file_info): file_info = probe_data.get('codec_name') diff --git a/pype/widgets/project_settings.py b/pype/widgets/project_settings.py index 3aa2fc06b6..28c6215915 100644 --- a/pype/widgets/project_settings.py +++ b/pype/widgets/project_settings.py @@ -274,10 +274,10 @@ class Project_name_getUI(QtWidgets.QWidget): # update all values in resolution if self.resolution_w.text(): self.projects[self.new_index]['custom_attributes'][ - 'resolution_width'] = int(self.resolution_w.text()) + "resolutionWidth"] = int(self.resolution_w.text()) if self.resolution_h.text(): self.projects[self.new_index]['custom_attributes'][ - 'resolution_height'] = int(self.resolution_h.text()) + "resolutionHeight"] = int(self.resolution_h.text()) def _update_attributes_by_list_selection(self): # generate actual selection index @@ -451,8 +451,8 @@ class Project_name_get(Project_name_getUI): # int(self.projects[self.new_index]['custom_attributes']['fps'])) # project.projectRoot() # print 'handles: {}'.format(self.projects[self.new_index]['custom_attributes']['handles']) - # print 'resolution_width: {}'.format(self.projects[self.new_index]['custom_attributes']['resolution_width']) - # print 'resolution_width: {}'.format(self.projects[self.new_index]['custom_attributes']['resolution_height']) + # print 'resolution_width: {}'.format(self.projects[self.new_index]['custom_attributes']["resolutionWidth"]) + # print 'resolution_width: {}'.format(self.projects[self.new_index]['custom_attributes']["resolutionHeight"]) # print "<< {}".format(self.projects[self.new_index]) # get path for the hrox file