Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

[QUAD] Enhancement: Use task frame data if specified for collect context entities #6338

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions openpype/plugins/publish/collect_context_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand All @@ -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)
Expand Down
Loading