diff --git a/openpype/hosts/maya/plugins/publish/collect_instances.py b/openpype/hosts/maya/plugins/publish/collect_instances.py index c0c182a02a..5f914b40d7 100644 --- a/openpype/hosts/maya/plugins/publish/collect_instances.py +++ b/openpype/hosts/maya/plugins/publish/collect_instances.py @@ -64,15 +64,30 @@ class CollectNewInstances(pyblish.api.InstancePlugin): instance.data["setMembers"] = members # TODO: This might make more sense as a separate collector - # Collect frameStartHandle and frameEndHandle if frames present - if "frameStart" in instance.data: - handle_start = instance.data.get("handleStart", 0) - frame_start_handle = instance.data["frameStart"] - handle_start - instance.data["frameStartHandle"] = frame_start_handle - if "frameEnd" in instance.data: - handle_end = instance.data.get("handleEnd", 0) - frame_end_handle = instance.data["frameEnd"] + handle_end - instance.data["frameEndHandle"] = frame_end_handle + # Convert frame values to integers + for attr_name in ( + "handleStart", "handleEnd", "frameStart", "frameEnd", + ): + value = instance.data.get(attr_name) + if value is not None: + instance.data[attr_name] = int(value) + + # Append start frame and end frame to label if present + if "frameStart" in instance.data and "frameEnd" in instance.data: + # Take handles from context if not set locally on the instance + for key in ["handleStart", "handleEnd"]: + if key not in instance.data: + value = instance.context.data[key] + if value is not None: + value = int(value) + instance.data[key] = value + + instance.data["frameStartHandle"] = int( + instance.data["frameStart"] - instance.data["handleStart"] + ) + instance.data["frameEndHandle"] = int( + instance.data["frameEnd"] + instance.data["handleEnd"] + ) def get_all_parents(self, nodes): """Get all parents by using string operations (optimization) diff --git a/openpype/hosts/maya/plugins/publish/collect_maya_scene_time.py b/openpype/hosts/maya/plugins/publish/collect_maya_scene_time.py index 7e198df14d..6a20cb151f 100644 --- a/openpype/hosts/maya/plugins/publish/collect_maya_scene_time.py +++ b/openpype/hosts/maya/plugins/publish/collect_maya_scene_time.py @@ -17,10 +17,12 @@ class CollectMayaSceneTime(pyblish.api.InstancePlugin): def process(self, instance): instance.data.update({ - "frameStart": cmds.playbackOptions(query=True, minTime=True), - "frameEnd": cmds.playbackOptions(query=True, maxTime=True), - "frameStartHandle": cmds.playbackOptions(query=True, - animationStartTime=True), - "frameEndHandle": cmds.playbackOptions(query=True, - animationEndTime=True) + "frameStart": int( + cmds.playbackOptions(query=True, minTime=True)), + "frameEnd": int( + cmds.playbackOptions(query=True, maxTime=True)), + "frameStartHandle": int( + cmds.playbackOptions(query=True, animationStartTime=True)), + "frameEndHandle": int( + cmds.playbackOptions(query=True, animationEndTime=True)) }) diff --git a/openpype/hosts/maya/plugins/publish/extract_playblast.py b/openpype/hosts/maya/plugins/publish/extract_playblast.py index 3ceef6f3d3..9580c13841 100644 --- a/openpype/hosts/maya/plugins/publish/extract_playblast.py +++ b/openpype/hosts/maya/plugins/publish/extract_playblast.py @@ -261,8 +261,8 @@ class ExtractPlayblast(publish.Extractor): "ext": capture_preset["Codec"]["compression"], "files": collected_files, "stagingDir": stagingdir, - "frameStart": start, - "frameEnd": end, + "frameStart": int(start), + "frameEnd": int(end), "fps": fps, "tags": tags, "camera_name": camera_node_name