Page 1 of 1

Python - Import file sequence into MediaPool (.dng)

PostPosted: Wed Jan 27, 2021 5:12 am
by jensenni
Hi All,
is there a way to import a file sequence (BMCC .dng) via python into a specific folder in the media pool?

I tried this via terminal:

import DaVinciResolveScript as dvr
resolve = dvr.scriptapp('Resolve')
pm = resolve.GetProjectManager()
proj = pm.GetCurrentProject()
tl = proj.GetCurrentTimeline()
mp = proj.GetMediaPool()
ms = resolve.GetMediaStorage()
ms.AddItemsToMediaPool('/Volumes/RAID/DATA/MEDIA/TWO_CHAIRS/DAY02/FW_A01_2020-12-08_2051_C0000/FW_A01_2020-12-08_2051_C0000_[000000-032898].dng')

... and that didn't work of course :)

DNG Folder File Structure is:
FW_A01_2020-12-01_2000_C0021_000000
FW_A01_2020-12-01_2000_C0021_000001
FW_A01_2020-12-01_2000_C0021_000002
FW_A01_2020-12-01_2000_C0021_000003
...etc.

Thank you so much!
Jens
_______________
macOS 10.13.2
DVR 15.3.1
python 3.6

Re: Python - Import file sequence into MediaPool (.dng)

PostPosted: Wed Jan 27, 2021 6:30 am
by Igor Riđanović
Try W_A01_2020-12-08_2051_C0000_000000.dng for the file name.

You need to run SetCurrentFolder() on the mp instance to set the current bin. AddItemsToMediaPool() will import to the current bin, whether that bin is set manually in the UI or by the script.

You also don't need to make an instance of the timeline in this case. It doesn't do anything right now.

Re: Python - Import file sequence into MediaPool (.dng)

PostPosted: Wed Jan 27, 2021 7:22 am
by jensenni
FW_A01_2020-12-08_2051_C0000_000000.dng as the filename did the trick :). Thank you!

Re: Python - Import file sequence into MediaPool (.dng)

PostPosted: Tue Feb 02, 2021 1:29 pm
by jensenni
Hi Igor, could you take a look at this post if you get a chance?
I tried the DVR API documentation on a small issue I have and
couldn't find anything on that topic. I thought you might be able
to guide me in the right direction.

viewtopic.php?f=21&t=133336&p=721060#p721060