Skip to content

Commit

Permalink
Refactor iter_all_media_pool_clips function for flexibility
Browse files Browse the repository at this point in the history
- Updated iter_all_media_pool_clips to accept a root parameter for custom starting point instead of always using the project's root folder.
  • Loading branch information
jakubjezek001 committed Jul 18, 2024
1 parent c268062 commit e62a9c7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions client/ayon_resolve/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,9 +960,13 @@ def get_reformated_path(path, padded=False, first=False):
return path


def iter_all_media_pool_clips():
"""Recursively iterate all media pool clips in current project"""
root = get_current_project().GetMediaPool().GetRootFolder()
def iter_all_media_pool_clips(root=None):
"""Recursively iterate all media pool clips in current project
Args:
root (resolve.Folder)[optional]: root folder / bin object
"""
root = root or get_current_project().GetMediaPool().GetRootFolder()
queue = [root]
for folder in queue:
for clip in folder.GetClipList():
Expand Down

0 comments on commit e62a9c7

Please sign in to comment.