Skip to content

[Editorial P2.5]: Retime effects - #71

Draft
jakubjezek001 wants to merge 3 commits into
feature/16-otio-markersfrom
feature/17-otio-effects
Draft

jakubjezek001 wants to merge 3 commits into
feature/16-otio-markersfrom
feature/17-otio-effects

Conversation

@jakubjezek001

@jakubjezek001 jakubjezek001 commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Changelog Description

New shared module ayon_editorial.otio.effects: retime effects (speed, freeze frame, time warp) written in exactly the shape ayon-core reads, plus a reader that mirrors ayon-core's.

Additional info

  • Round-trip tests on all 14 retimed fixtures copied from ayon-core's editorial tests (tests/resources/ayon_core_retime/, Apache 2.0); the Hiero-shaped ones come back byte for byte.
  • The Hiero and Flame writers are reproduced in the tests. Hiero writes the speed effect and then each time warp; Flame writes a time warp or the speed effect, never both. add_retime_effects is the Hiero combination, Flame calls add_timewarp_effect or add_speed_effect. A non-animated Hiero time warp keeps its numeric lookup.
  • lookup_from_frames holds the lookup arithmetic both hosts do; Flame's timewarp XML parsing (tw_bake.py) stays in Flame.
  • Deep-tier review done (the manifest asks for it); its two findings (Flame single effect, Hiero numeric lookup) are fixed and tested.
  • Also in this PR: the manifest marks P2 and P2.1 to P2.5 as in progress / in review.

Testing notes:

  1. ./tools/manage.sh run-tests (tests/test_otio_effects.py)

Dependency

Close #17

Checklist

  • ruff check and pytest pass (Python 3.9 with OTIO 0.15, 0.16, 0.17 and 0.18)
  • python create_package.py --skip-zip builds
  • No frozen contract changed
  • Settings key renamed only with a conversion function (none renamed)
  • Layer rules kept (tests/test_dcc_agnostic.py)

@jakubjezek001
jakubjezek001 added this pull request to stack #72 October 29, 2026 15:32
@jakubjezek001 jakubjezek001 changed the title feature/17 otio effects [Editorial P2.5]: Retime effects Oct 29, 2026
@jakubjezek001 jakubjezek001 added the type: feature Adding something new and exciting to the product label Oct 29, 2026
@jakubjezek001
jakubjezek001 force-pushed the feature/17-otio-effects branch from c3121e6 to 616e780 Compare October 30, 2026 11:10
@jakubjezek001
jakubjezek001 marked this pull request as draft October 30, 2026 13:40
@jakubjezek001

Copy link
Copy Markdown
Member Author

Cross-review finding 71-1: create_timewarp_effect writes a numeric lookup that crashes ayon-core when it is not 0

client/ayon_editorial/otio/effects.py:126-131 (comment and fallback), test tests/test_otio_effects.py:317-327

Goal of the issue: "exactly the keys ayon-core reads". For a non-list lookup the writer stores the number as is, and the comment says "ayon-core ignores it when it is 0". ayon-core (ayon_core/pipeline/editorial.py get_media_range_with_retimes) does if not lookup: continue and then tw_node["lookup"] = list(lookup). Any non-zero number reaches list(<float>):

clip.effects.append(create_timewarp_effect(2.5, name="TimeWarp2", metadata={"length": 12.0}))
list(clip.effects[0].metadata.get("lookup"))   # what ayon-core runs
-> TypeError: 'float' object is not iterable

get_retime_info already knows this (it logs and skips), so the reader side is hardened but the writer still produces a clip the real reader cannot process, and add_retime_effects(get_retime_info(clip)) silently drops what create_timewarp_effect would have kept. The test only covers 0.0, so the crash case is untested. I could not check what Hiero returns for node["lookup"].value() on a non-animated warp with a non-zero constant; if that cannot happen, the docstring should say so.

Fix: for a non-zero number, either skip the effect or log and write nothing (the reader result for 0 and for skipped is the same: no warp node), and add a test with a non-zero number. If the Hiero shape must be kept byte for byte, say in the docstring that a non-zero value breaks ayon-core.

Severity: minor.

@jakubjezek001
jakubjezek001 force-pushed the feature/17-otio-effects branch from 616e780 to 47b38a4 Compare October 30, 2026 13:49
@jakubjezek001

Copy link
Copy Markdown
Member Author

Author answer to 71-1: not changed, left for the human to decide.

  • Hiero writes the knob value as it reads it (metadata["lookup"] = value for a knob that is not animated). The builder keeps that so a Hiero export stays byte-equal; the value is 0.0 in practice, which ayon-core skips (if not lookup: continue). get_retime_info also skips a numeric lookup, with a warning.
  • A non-zero constant would make list(lookup) in ayon_core/pipeline/editorial.py:384 raise, but that is ayon-core's reader being strict about a value no host produces today. Rewriting the value here would break the byte-equal goal for Hiero; I would rather fix it in ayon-core or keep it as is. If you want this writer to be defensive anyway (wrap a non-zero number as [value]), say so and I add it with a test.
  • Not run: OTIO 0.16/0.17 locally for this PR; CI covers them.

@jakubjezek001
jakubjezek001 force-pushed the feature/17-otio-effects branch from 47b38a4 to 4f2a22d Compare October 30, 2026 13:55
@jakubjezek001

Copy link
Copy Markdown
Member Author

Author note after round 2: the reviewer accepted 71-1 as minor. Added the one docstring line it asked for (create_timewarp_effect: a numeric 0 is ignored by ayon-core, a non-zero number makes its list(lookup) raise). No wire format change.

@jakubjezek001
jakubjezek001 force-pushed the feature/17-otio-effects branch from 4f2a22d to 9dc46d4 Compare October 30, 2026 14:15
Speed, freeze frame and time warp effects in the shape ayon-core reads,
a reader that mirrors ayon-core and the lookup helper. Round-trip tests on
the 14 retimed ayon-core fixtures and the Hiero and Flame writers.
Deep-tier review applied: Flame writes a warp or the speed, Hiero may
store a number as lookup.
P2.1 to P2.5 are in review.
Cross-review 71-1 (accepted as minor, docstring only).
@jakubjezek001
jakubjezek001 force-pushed the feature/17-otio-effects branch from 9dc46d4 to 19dafac Compare October 30, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Adding something new and exciting to the product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Editorial P2.5]: Retime effects (otio/effects.py)

1 participant