Skip to content

Commit

Permalink
Merge pull request #7 from ynput/draft/fix-deprecated-each_child
Browse files Browse the repository at this point in the history
Fix deprecated opentimelineio 'each_child' methods (To Be Discussed).
  • Loading branch information
jakubjezek001 authored Aug 20, 2024
2 parents 8ab9f41 + 6fe6ef7 commit b23b749
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 2 additions & 6 deletions client/ayon_traypublisher/plugins/create/create_editorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,7 @@ def _get_clip_instances(
product_type_presets (list): list of dict settings product presets
"""

tracks = [
track for track in otio_timeline.each_child(
descended_from_type=otio.schema.Track)
if track.kind == "Video"
]
tracks = otio_timeline.video_tracks()

# media data for audio stream and reference solving
media_data = self._get_media_source_metadata(media_path)
Expand All @@ -372,7 +368,7 @@ def _get_clip_instances(
except AttributeError:
track_start_frame = 0

for otio_clip in track.each_child():
for otio_clip in track.find_clips():
if not self._validate_clip_for_processing(otio_clip):
continue

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ def _get_otio_clip(self, instance):
otio_timeline = context.data["otioTimeline"]

clips = [
clip for clip in otio_timeline.each_child(
descended_from_type=otio.schema.Clip)
clip for clip in otio_timeline.find_clips()
if clip.name == otio_clip.name
if clip.parent().kind == "Video"
]
Expand Down

0 comments on commit b23b749

Please sign in to comment.