How do I replace source media via python api?

Hi all,
I’m just starting to get familiar with the RV python API, and am having trouble finding an adequate answer in the available documentation and references.

I would like to replace the media for a specific source in my timeline. Basically replicate the
File->Replace Source Media… operation using python commands.

I’ve tried rv.commands.addToSource() which allows me to add media to a source, but I’ve not found a way to target the source it adds to, or how to remove the existing source media.

Thanks :slight_smile:

Ok, I think I may have discovered the answer as soon as asking the question :man_facepalming:

I’ll just leave this here for posterity…
rv.commands.setSourceMedia(current_source, [media_path])

3 Likes