"bmd" is not defined Visual Studio Code

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

MazenIIXIS

  • Posts: 1
  • Joined: Fri Jun 13, 2025 5:30 am
  • Real Name: Abraham Nightingale

"bmd" is not defined Visual Studio Code

PostFri Jun 13, 2025 5:47 am

Hello, I'm attempting to write a script to automate a certain repetitive task. It's my first time tackling this via scripting. I'm writing in Python. I've used an extension created by asherroland on YouTube. The problem is that for some reason bmd is undefined. The error message I got is:

"bmd" is not defined Pylance(reportUndefinedVariable) [Ln 2, Col 11]

The lines that I got is this:

resolve = bmd.scriptapp('Resolve')
project_manager = resolve.GetProjectManager()
media_storage = resolve.GetMediaStorage()
project = project_manager.GetCurrentProject()
timeline = project.GetCurrentTimeline()
media_pool = project.GetMediaPool()
gallery = project.GetGallery()

I'm using DaVinci Resolve 19, version 19.0. I've also attempted to run the script inside DaVinci Resolve 19, and I got an error message:

Traceback (most recent call last):
File "<nofile>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'GetProjectManager'

I know it's because bmd was not defined. Yet, bmd worked inside DaVinci Resolve 19's console, it just wasn't defined in Visual Studio Code. I've informed the extension creator of it, he said to contact bmd support.
Offline

Christoph Schmid

  • Posts: 923
  • Joined: Thu Sep 26, 2019 10:15 am
  • Real Name: Christoph Schmid

Re: "bmd" is not defined Visual Studio Code

PostMon Jun 23, 2025 9:39 am

First of all you forgot the line:
Code: Select all
import DaVinciResolveScript as bmd

that's why "bmd" is not defined....
BUT
if you run your script inside DR, you must not use:
Code: Select all
import DaVinciResolveScript as bmd
resolve = bmd.scriptapp(‘Resolve’)

Just comment these lines out and it should work.
If you want to use the script externally, you need these lines.

Davinci Resolve Studio 20.0.1 Build 6
Windows 10 Pro 22H2
Davinci Resolve Studio 19.1.4 Build 11
Linux Ubuntu Studio 24.04 (Rocky 8.6 Container)

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 11 guests