opentimelineio.algorithms.track_algo

Algorithms for track objects.

opentimelineio.algorithms.track_algo.track_trimmed_to_range(in_track, trim_range)

Returns a new track that is a copy of the in_track, but with items outside the trim_range removed and items on the ends trimmed to the trim_range.

Note

The track is never expanded, only shortened.

Please note that you could do nearly the same thing non-destructively by just setting the Track’s source_range but sometimes you want to really cut away the stuff outside and that’s what this function is meant for.

Parameters:
Returns:

New trimmed track

Return type:

Track

opentimelineio.algorithms.track_algo.track_with_expanded_transitions(in_track)

Expands transitions such that neighboring clips are trimmed into regions of overlap.

For example, if your track is:

Clip1, T, Clip2

will return:

Clip1', (Clip1_t, T, Clip2_t), Clip2'

Where Clip1' is the part of Clip1 not in the transition, Clip1_t is the part inside the transition and so on.

Note

The items used in a transition are encapsulated in tuples.

Parameters:

in_track (Track) – Track to expand

Returns:

Track

Return type:

list[Track]