From 1e30f0313f7bbf485122b8e6e49d0bf62d4ee4b6 Mon Sep 17 00:00:00 2001 From: Cyprien CAILLOT Date: Wed, 11 Sep 2024 16:02:39 +0200 Subject: [PATCH] Enhancement: Use task frame data if specified for collect context entities --- .../plugins/publish/collect_context_entities.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/openpype/plugins/publish/collect_context_entities.py b/openpype/plugins/publish/collect_context_entities.py index 312f5f0eb57..6b07ebaa90c 100644 --- a/openpype/plugins/publish/collect_context_entities.py +++ b/openpype/plugins/publish/collect_context_entities.py @@ -57,14 +57,24 @@ def process(self, context): asset_tasks = data.get("tasks") or {} task_info = asset_tasks.get(task_name) or {} task_type = task_info.get("type") + task_custom_atr = task_info.get("custom_attributes") or {} + task_frame_start = task_custom_atr.get("frameStart") + task_frame_end = task_custom_atr.get("frameEnd") + task_handle_start = task_custom_atr.get("handleStart") + task_handle_end = task_custom_atr.get("handleEnd") + context.data["taskType"] = task_type frame_start = data.get("frameStart") + if task_frame_start is not None: + frame_start = int(task_frame_start) if frame_start is None: frame_start = 1 self.log.warning("Missing frame start. Defaulting to 1.") frame_end = data.get("frameEnd") + if task_frame_end is not None: + frame_end = int(task_frame_end) if frame_end is None: frame_end = 2 self.log.warning("Missing frame end. Defaulting to 2.") @@ -73,7 +83,12 @@ def process(self, context): context.data["frameEnd"] = frame_end handle_start = data.get("handleStart") or 0 + if task_handle_start is not None: + handle_start = int(task_handle_start) + handle_end = data.get("handleEnd") or 0 + if task_handle_end is not None: + handle_end = int(task_handle_end) context.data["handleStart"] = int(handle_start) context.data["handleEnd"] = int(handle_end)