Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong retimed detection on image sequence clip. #897

Merged
merged 42 commits into from
Oct 3, 2024
Merged
Changes from 6 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
14244e1
Fix wrong retimed detection on image sequence clip.
robin-ynput Sep 17, 2024
318ce6b
Fix lint.
robin-ynput Sep 17, 2024
5fbe7d4
Merge branch 'develop' into bugfix/#895_fix_otio_subset_resources_img…
robin-ynput Sep 17, 2024
d899f11
Merge branch 'develop' into bugfix/#895_fix_otio_subset_resources_img…
jakubjezek001 Sep 18, 2024
ac226a3
Apply suggestions from code review
robin-ynput Sep 18, 2024
0836fb8
Apply suggestions from code review
robin-ynput Sep 18, 2024
efc31f0
Consolidate pipeline.editorial.get_media_range_with_retimes
robin-ynput Sep 18, 2024
ef6693f
Add unit tests.
robin-ynput Sep 18, 2024
f4967d5
Merge with PR changes
robin-ynput Sep 18, 2024
b0b509d
Add unit tests
robin-ynput Sep 18, 2024
be2b8d5
Fix lint.
robin-ynput Sep 18, 2024
6c66933
Merge branch 'develop' into bugfix/#895_fix_otio_subset_resources_img…
jakubjezek001 Sep 19, 2024
4f2340a
Update client/ayon_core/pipeline/editorial.py
robin-ynput Sep 23, 2024
f9ed6f5
Fix typos.
robin-ynput Sep 23, 2024
d2b9337
Adjust test docstring.
robin-ynput Sep 23, 2024
201c91a
Merge branch 'develop' into bugfix/#895_fix_otio_subset_resources_img…
jakubjezek001 Sep 24, 2024
77fac00
Make it work even with image sequence and embedded timecodes.
robin-ynput Sep 24, 2024
6d31cd7
Add unit tests.
robin-ynput Sep 24, 2024
4b27971
Adjust comment.
robin-ynput Sep 24, 2024
885f8ac
Update client/ayon_core/pipeline/editorial.py
robin-ynput Sep 24, 2024
2980f10
Add client path to sys.path and run repository from code
jakubjezek001 Sep 25, 2024
7a83b8e
Add test for tail handles only.
robin-ynput Sep 25, 2024
ee749d0
Merge branch 'develop' into bugfix/#895_fix_extract_otio_review
robin-ynput Sep 25, 2024
ee95a19
Merge branch 'develop' into bugfix/#895_fix_otio_subset_resources_img…
robin-ynput Sep 25, 2024
8136ca5
merge with latest changes
robin-ynput Sep 25, 2024
a10f0e5
Implement linux counterpart to manage.sh
rdelillo Sep 25, 2024
beee0ef
Adjust feedback from PR.
robin-ynput Sep 30, 2024
3a75ebc
Adjust manage.sh and manage.ps1 run documentation.
robin-ynput Sep 30, 2024
9379365
Update client/ayon_core/plugins/publish/extract_otio_review.py
robin-ynput Oct 1, 2024
d69edc6
Add backward-compatibility for relative source ranges.
robin-ynput Oct 1, 2024
abd0e7d
Add backward-compatibility for relative source ranges.
robin-ynput Oct 1, 2024
8182914
Fix linting.
robin-ynput Oct 1, 2024
1072fc9
Merge pull request #916 from ynput/bugfix/#895_fix_extract_otio_review
iLLiCiTiT Oct 2, 2024
029cbe4
Merge branch 'develop' into bugfix/#895_fix_otio_subset_resources_img…
jakubjezek001 Oct 2, 2024
05291b2
ruff suggestions
jakubjezek001 Oct 2, 2024
7bd382a
Refactor Anatomy NamedTuple
jakubjezek001 Oct 2, 2024
4130293
Fix multiple review clips in OTIO review plugins with tests.
rdelillo Oct 2, 2024
1fce610
Fix linting
rdelillo Oct 2, 2024
89a3b42
Merge branch 'develop' into bugfix/#895_fix_otio_subset_resources_img…
rdelillo Oct 2, 2024
0ab128b
Add rounding support for OTIO <= 0.16.0
rdelillo Oct 2, 2024
df69603
Merge branch 'develop' into bugfix/#895_fix_otio_subset_resources_img…
jakubjezek001 Oct 3, 2024
56b7ebb
Merge branch 'develop' into bugfix/#895_fix_otio_subset_resources_img…
jakubjezek001 Oct 3, 2024
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
42 changes: 26 additions & 16 deletions client/ayon_core/pipeline/editorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,24 @@ def get_media_range_with_retimes(otio_clip, handle_start, handle_end):
media_in = available_range.start_time.value
media_out = available_range.end_time_inclusive().value

# Ensure image sequence media_ref source and
# available range are absolute.
media_ref = otio_clip.media_reference
if (
hasattr(otio.schema, "ImageSequenceReference")
and isinstance(media_ref, otio.schema.ImageSequenceReference)
and media_in != media_ref.start_frame
):
media_in = media_ref.start_frame
media_out += media_ref.start_frame
robin-ynput marked this conversation as resolved.
Show resolved Hide resolved
source_range_start = otio.opentime.RationalTime(
media_in + source_range.start_time.value,
)
source_range = otio.opentime.TimeRange(
start_time=source_range_start,
duration=source_range.duration
)

robin-ynput marked this conversation as resolved.
Show resolved Hide resolved
# modifiers
time_scalar = 1.
offset_in = 0
Expand Down Expand Up @@ -224,38 +242,30 @@ def get_media_range_with_retimes(otio_clip, handle_start, handle_end):
offset_in *= time_scalar
offset_out *= time_scalar

# filip offset if reversed speed
# flip offset if reversed speed
if time_scalar < 0:
_offset_in = offset_out
_offset_out = offset_in
offset_in = _offset_in
offset_out = _offset_out
offset_in, offset_out = offset_out, offset_in

# scale handles
handle_start *= abs(time_scalar)
handle_end *= abs(time_scalar)

# filip handles if reversed speed
# flip handles if reversed speed
if time_scalar < 0:
_handle_start = handle_end
_handle_end = handle_start
handle_start = _handle_start
handle_end = _handle_end
jakubjezek001 marked this conversation as resolved.
Show resolved Hide resolved
handle_start, handle_end = handle_end, handle_start

source_in = source_range.start_time.value

media_in_trimmed = (
media_in + source_in + offset_in)
robin-ynput marked this conversation as resolved.
Show resolved Hide resolved
media_out_trimmed = (
media_in + source_in + (
media_in_trimmed = source_in + offset_in
media_out_trimmed = (media_in_trimmed + (
((source_range.duration.value - 1) * abs(
time_scalar)) + offset_out))

# calculate available handles
if (media_in_trimmed - media_in) < handle_start:
handle_start = (media_in_trimmed - media_in)
handle_start = max(0, media_in_trimmed - media_in)
if (media_out - media_out_trimmed) < handle_end:
handle_end = (media_out - media_out_trimmed)
handle_end = max(0, media_out - media_out_trimmed)

# create version data
version_data = {
Expand Down
Loading