diff --git a/pype/nuke/lib.py b/pype/nuke/lib.py index 247780855b..19781d6bf4 100644 --- a/pype/nuke/lib.py +++ b/pype/nuke/lib.py @@ -405,6 +405,9 @@ def reset_frame_range_handles(): log.info("_frameRange: {}".format(range)) log.info("frameRange: {}".format(vv['frame_range'].value())) + vv['frame_range'].setValue(range) + vv['frame_range_lock'].setValue(True) + def get_avalon_knob_data(node): import toml diff --git a/pype/plugins/global/publish/integrate_new.py b/pype/plugins/global/publish/integrate_new.py index 3fa17af187..2bb5b3bd60 100644 --- a/pype/plugins/global/publish/integrate_new.py +++ b/pype/plugins/global/publish/integrate_new.py @@ -299,10 +299,10 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): repre['published_path'] = dst_collection.format() index_frame_start = None - if instance.data.get("frameStart"): + if repre.get('startFrame'): frame_start_padding = len(str( - instance.data.get("frameStart"))) - index_frame_start = instance.data.get("frameStart") + repre.get('endFrame'))) + index_frame_start = repre.get('startFrame') for i in src_collection.indexes: src_padding = src_collection.format("{padding}") % i diff --git a/pype/plugins/nuke/create/create_write.py b/pype/plugins/nuke/create/create_write.py index 347a4a1fd2..ff1fde6638 100644 --- a/pype/plugins/nuke/create/create_write.py +++ b/pype/plugins/nuke/create/create_write.py @@ -29,6 +29,7 @@ class CreateWriteRender(avalon.nuke.Creator): family = "{}_write".format(preset) families = preset icon = "sign-out" + defaults = ["Main", "Mask"] def __init__(self, *args, **kwargs): super(CreateWriteRender, self).__init__(*args, **kwargs) @@ -72,6 +73,7 @@ class CreateWritePrerender(avalon.nuke.Creator): family = "{}_write".format(preset) families = preset icon = "sign-out" + defaults = ["Main", "Mask"] def __init__(self, *args, **kwargs): super(CreateWritePrerender, self).__init__(*args, **kwargs) diff --git a/pype/plugins/nukestudio/publish/collect_handles.py b/pype/plugins/nukestudio/publish/collect_handles.py index 03652989b8..104a60d02c 100644 --- a/pype/plugins/nukestudio/publish/collect_handles.py +++ b/pype/plugins/nukestudio/publish/collect_handles.py @@ -41,7 +41,7 @@ class CollectClipHandles(api.ContextPlugin): }) for instance in filtered_instances: - if not instance.data.get("main") and not instance.data.get("handleTag"): + if not instance.data.get("main") or not instance.data.get("handleTag"): self.log.debug("Synchronize handles on: `{}`".format( instance.data["name"])) name = instance.data["asset"] diff --git a/pype/plugins/nukestudio/publish/collect_hierarchy_context.py b/pype/plugins/nukestudio/publish/collect_hierarchy_context.py index 67591a63ee..bbae365fa6 100644 --- a/pype/plugins/nukestudio/publish/collect_hierarchy_context.py +++ b/pype/plugins/nukestudio/publish/collect_hierarchy_context.py @@ -198,7 +198,6 @@ class CollectHierarchyContext(pyblish.api.ContextPlugin): self.log.debug("__ s_asset_data: {}".format(s_asset_data)) name = instance.data["asset"] = s_asset_data["asset"] instance.data["parents"] = s_asset_data["parents"] - instance.data["parents"] = s_asset_data["parents"] instance.data["hierarchy"] = s_asset_data["hierarchy"] instance.data["tasks"] = s_asset_data["tasks"] @@ -233,17 +232,17 @@ class CollectHierarchyContext(pyblish.api.ContextPlugin): 'handles': int(instance.data.get('handles')), 'handle_start': handle_start, 'handle_end': handle_end, - 'fstart': int(instance.data["startFrame"] - handle_start), - 'fend': int(instance.data["endFrame"] + handle_end), + 'fstart': int(instance.data["startFrame"]), + 'fend': int(instance.data["endFrame"]), 'fps': instance.data["fps"], "edit_in": int(instance.data["startFrame"]), "edit_out": int(instance.data["endFrame"]) } if start_frame is not 0: in_info['custom_attributes'].update({ - 'fstart': start_frame - handle_start, + 'fstart': start_frame, 'fend': start_frame + ( - instance.data["endFrame"] - instance.data["startFrame"]) + handle_end + instance.data["endFrame"] - instance.data["startFrame"]) }) # adding SourceResolution if Tag was present s_res = instance.data.get("sourceResolution") diff --git a/pype/plugins/nukestudio/publish/collect_plates.py b/pype/plugins/nukestudio/publish/collect_plates.py index 77ed4097c8..abd02bfa78 100644 --- a/pype/plugins/nukestudio/publish/collect_plates.py +++ b/pype/plugins/nukestudio/publish/collect_plates.py @@ -41,7 +41,7 @@ class CollectPlates(api.InstancePlugin): data[key] = value data["family"] = family.lower() - data["families"] = ["ftrack"] + data["families"] = ["ftrack"] + instance.data["families"][1:] data["source"] = data["sourcePath"] subset = "" @@ -110,6 +110,9 @@ class CollectPlates(api.InstancePlugin): self.log.debug("Creating instance with name: {}".format(data["name"])) instance.context.create_instance(**data) + # # remove original instance + # instance.context.remove(instance) + class CollectPlatesData(api.InstancePlugin): """Collect plates""" @@ -217,9 +220,11 @@ class CollectPlatesData(api.InstancePlugin): padding=padding, ext=ext ) - start_frame = source_first_frame + self.log.debug("__ source_in_h: {}".format(source_in_h)) + self.log.debug("__ source_out_h: {}".format(source_out_h)) + start_frame = source_first_frame + source_in_h duration = source_out_h - source_in_h - end_frame = source_first_frame + duration + end_frame = start_frame + duration files = [file % i for i in range(start_frame, (end_frame + 1), 1)] except Exception as e: self.log.debug("Exception in file: {}".format(e)) @@ -276,8 +281,8 @@ class CollectPlatesData(api.InstancePlugin): 'stagingDir': staging_dir, 'name': ext, 'ext': ext, - 'startFrame': start_frame, - 'endFrame': end_frame, + 'startFrame': frame_start - handle_start, + 'endFrame': frame_end + handle_end, } 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 27cf79fa44..7b18c605a7 100644 --- a/pype/plugins/nukestudio/publish/collect_reviews.py +++ b/pype/plugins/nukestudio/publish/collect_reviews.py @@ -87,9 +87,15 @@ class CollectReviews(api.InstancePlugin): self.log.debug("Instance review: {}".format(rev_inst.data["name"])) + # getting file path parameters file_path = rev_inst.data.get("sourcePath") file_dir = os.path.dirname(file_path) file = os.path.basename(file_path) + ext = os.path.splitext(file)[-1][1:] + + # adding annotation to lablel + instance.data["label"] += " + review (.{})".format(ext) + instance.data["families"].append("review") # adding representation for review mov representation = { "files": file, @@ -101,7 +107,7 @@ class CollectReviews(api.InstancePlugin): "preview": True, "thumbnail": False, "name": "preview", - "ext": os.path.splitext(file)[-1][1:] + "ext": ext } instance.data["representations"].append(representation)