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

Commit

Permalink
Enhancement: Use task frame data if specified for collect context ent…
Browse files Browse the repository at this point in the history
…ities
  • Loading branch information
Cyprien CAILLOT committed Sep 11, 2024
1 parent d9731d0 commit 1e30f03
Showing 1 changed file with 15 additions and 0 deletions.
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

0 comments on commit 1e30f03

Please sign in to comment.