MediaPool.GetCurrentFolder() returns None on a smart bin

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

iz2022

  • Posts: 4
  • Joined: Sun Jan 30, 2022 6:49 pm
  • Real Name: Ido Zilberberg

MediaPool.GetCurrentFolder() returns None on a smart bin

PostFri Sep 30, 2022 7:40 pm

Hello,

When executing the following code (Python3):
Code: Select all
pm = resolve.GetProjectManager()
proj = pm.GetCurrentProject()
mp = proj.GetMediaPool()
bin = mp.GetCurrentFolder()
print('In bin', bin.GetName())


If the user first clicks a real bin, then the value of bin contains the correct folder (that is, bin.GetName() prints the currently selected bin name)
However if the user has clicked a smart bin, the value of bin is None.


1) Is there an API to get which smart bin the user is on? naturally it is sometimes desirable to iterate over clips in a smart bin, not just a regular bin.

2) As an alternative, is there an API to get a list of the selected clips? if so, then selecting all clips would allow the script to enumerate them.

3) Where is the updated scripting documentation, anyway? the latest "formal" docs seem to be from 2016.

Thank you fellow developers!

Ido
DR Studio 18.0.3, Win10 Pro x64
Ryzen 7 3700X 8-Core 3.6 GHz | 32 GB RAM | Radeon RX 5700 XT 8GB | 1TB NVMe
Speed Editor
Offline

Peter Chamberlain

Blackmagic Design

  • Posts: 12475
  • Joined: Wed Aug 22, 2012 7:08 am

Re: MediaPool.GetCurrentFolder() returns None on a smart bin

PostSun Oct 02, 2022 6:20 am

Documentation is in the help menu.
DaVinci Resolve Product Manager
Offline

Octavian Mot

  • Posts: 247
  • Joined: Mon Aug 25, 2014 2:42 pm
  • Location: Germany

Re: MediaPool.GetCurrentFolder() returns None on a smart bin

PostTue Oct 04, 2022 7:09 pm

iz2022 wrote:1) Is there an API to get which smart bin the user is on? naturally it is sometimes desirable to iterate over clips in a smart bin, not just a regular bin.
Nope, not that I know of. This is a limitation of the API. You also get None when the user selects multiple bins.

iz2022 wrote:2) As an alternative, is there an API to get a list of the selected clips? if so, then selecting all clips would allow the script to enumerate them.
Nope, there isn't any option for this either.


Overall there are a lot of things one can do with the API, but unfortunately there are a lot of limitations too, especially when it comes to user interactions with the UI...
Trying to keep it together at mots.us
Taming AI for filmmaking at StoryToolkit.ai

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 3 guests