mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
frame_in/out fallbacks
This commit is contained in:
parent
3970229ce5
commit
78bda28da4
1 changed files with 13 additions and 4 deletions
|
|
@ -68,10 +68,19 @@ def update_op_assets(
|
||||||
item_data.update(item.get("data") or {})
|
item_data.update(item.get("data") or {})
|
||||||
item_data["zou"] = item
|
item_data["zou"] = item
|
||||||
|
|
||||||
# Asset settings
|
# == Asset settings ==
|
||||||
item_data["frameStart"] = item_data.get("frame_in")
|
# Frame in, fallback on 0
|
||||||
item_data["frameEnd"] = item_data.get("frame_out")
|
frame_in = int(item_data.get("frame_in") or 0)
|
||||||
# Sentinel for fps, fallback to project's value when entity fps is deleted
|
item_data["frameStart"] = frame_in
|
||||||
|
# Frame out, fallback on frame_in + duration
|
||||||
|
frames_duration = int(item.get("nb_frames") or 1)
|
||||||
|
frame_out = (
|
||||||
|
item_data["frame_out"]
|
||||||
|
if item_data.get("frame_out")
|
||||||
|
else frame_in + frames_duration
|
||||||
|
)
|
||||||
|
item_data["frameEnd"] = int(frame_out)
|
||||||
|
# Fps, fallback to project's value when entity fps is deleted
|
||||||
if not item_data.get("fps") and item_doc["data"].get("fps"):
|
if not item_data.get("fps") and item_doc["data"].get("fps"):
|
||||||
project_doc = project_col.find_one({"type": "project"})
|
project_doc = project_col.find_one({"type": "project"})
|
||||||
item_data["fps"] = project_doc["data"]["fps"]
|
item_data["fps"] = project_doc["data"]["fps"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue