MediaPool.GetCurrentFolder() returns None on a smart bin

Hello,
When executing the following code (Python3):
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
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