Importing Image Sequences with AddClipMattesToMediaPool()

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

pennyslugger

  • Posts: 1
  • Joined: Wed Apr 30, 2025 2:33 am
  • Real Name: Christien Di Angello

Importing Image Sequences with AddClipMattesToMediaPool()

PostWed Apr 30, 2025 2:47 am

Hello, I'm working on developing a script for our online editors that can import DPX sequences as clip mattes via the AddClipMattesToMediaPool([]) function.

Our vendors usually deliver mattes as DPX sequences. These sequences can be manually imported as a Clip Matte through Media Storage. I've found other commands (i.e. ImportMedia([{}])) that can import media as image sequences, but they take whole dictionaries and cannot import media as Mattes attached to other clips.

The AddClipMattesToMediaPool([]) function is built for what I'm trying to achieve but it appears that it can only take a file path as it's input with no area to define it as an image sequence.

Am I missing something? How can I make sure it recognizes this file path as an Image Sequence so that DPX sequences import as one Matte?
Offline

not_named_dan

  • Posts: 5
  • Joined: Wed Nov 20, 2024 6:40 pm
  • Location: Burbank, CA
  • Real Name: Nathan Dan

Re: Importing Image Sequences with AddClipMattesToMediaPool(

PostFri Aug 08, 2025 10:20 pm

Hi Christien,

I'm working on a similar script and ran into this issue. After some troubleshooting, I found that you have to edit the file path so that it points to the parent directory of the image sequence, not the image sequence itself.

The problem now is that I have to add a function to my script that truncates the file path returned by GetClipProperty('File Path') from '<some path>/matte/matte.[1001-1099].dpx' to just '<some path>/matte'. It would be helpful if AddClipMattesToMediaPool() understood image sequence syntax without requiring this workaround though...

Hope this helps!
Offline

sushi ninja

  • Posts: 27
  • Joined: Tue Feb 14, 2023 8:01 am
  • Real Name: Satoru Taguchi

Re: Importing Image Sequences with AddClipMattesToMediaPool(

PostWed Aug 27, 2025 1:53 am

Hi.

I encountered the same issue and tried Nathan's approach, but whilst it returned true in my environment, it did not actually function.

Upon enquiring with BMD regarding this, it appears necessary to store the file paths for each frame within the image sequence in an array (List) and use that as the argument for AddClipMattesToMediaPool().

For example, if the path of the sequence you wish to add is displayed as ‘<some path>/matte/matte.[1001-1099].dpx’ in Resolve, the following Lua code should achieve the intended behaviour:
( I'm no expert on code, so this might be a bit off )

Code: Select all
resolve = Resolve()
local fusion = resolve:Fusion()
local project = resolve:GetProjectManager():GetCurrentProject()
local media_pool = project:GetMediaPool()
local media_storage = resolve:GetMediaStorage()

local selected_item_list = media_pool:GetSelectedClips()
local media_pool_item = selected_item_list[1]

local some_sequence_matte_path = '<some path>/matte/matte.%04d.dpx'

local matte_paths = {}
for i = 1001, 1099 do
   local image_path = string.format(some_sequence_matte_path, i)
   table.insert(matte_paths, image_path)
end
media_storage:AddClipMattesToMediaPool(media_pool_item, matte_paths)

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 18 guests