A practical Resolve Scripting API introduction for Windows, macOS and Linux: Free/Studio boundaries and the 21.1 changes, Python setup, a downloadable read-only probe, JSON results and exit-code diagnostics.
What you will make
JSON from your installation with product/version, current project and timeline availability, an exit code and the first unsuccessful stage when a failure occurs.
- Desktop Resolve and the Developer/Scripting documentation from that installation; an appropriate Studio installation for external Python.
- Compatible 64-bit Python; the download requires Python 3.8 or newer, but a version number alone does not establish native-library compatibility.
- An existing practice project and timeline for a positive check; the code creates no project, imports no media and saves no changes.
- Ability to run a terminal command and distinguish a Python variable, a file path and an environment variable.
The result and the Free/Studio boundary
The first result is to read the product and version of a running Resolve instance, then inspect its current project and timeline. There is no need to create a Hello World project to test the connection. Success establishes access to these particular read operations; it does not verify the entire API or the correctness of operations that change a project.
The site's davinci-20 collection name does not make every release behave alike. In Resolve 21.1, Blackmagic moved Python scripting to Studio, added built-in Python for the Console and ended Python 2 support. For 20.x, follow the README from that release; do not assume that the built-in Python described for 21.1 exists in Resolve 20.
| Installation | Console inside Resolve | Python from a terminal |
|---|---|---|
| 20.x Free · Windows/macOS/Linux | Check the available Python mode and the rules in that build's local SDK. Console success does not establish external access. | This lesson's external route targets Studio; do not extend a Console result to an outside process. |
| 20.x Studio · standard desktop installation | Use Python supported by the installed SDK; do not assume the bundled runtime introduced in 21.1. | Compatible external Python, the official module and permitted Local access. |
| 21.1 Free · Windows/macOS/Linux | Python scripting moved to Studio; the Console is not offered as a workaround. | The external Python route requires Studio. |
| 21.1 Studio · Blackmagic installer | The release adds built-in Python for the Console. Python 2 is no longer supported. | Use the interpreter and launch method described in your local README; configure the module and library for your own Python. |
| 21.1 Mac App Store Studio / Resolve for iPad | The official 21.1 feature table excludes Scripting API in Mac App Store installations; it also lists no iPad support. | These installations are outside this lesson's reproducible external route. |
- Python changes in Resolve 21.1
Official release notes, Notes section.
- 21.1 feature comparison
Scripting API on page 4; the Mac App Store restriction in footnote 7 on page 11.
Find the SDK belonging to the running installation
Open Developer/Scripting through Help → Documentation → Developer, or locate that directory in the installation. Menu nesting can vary. Look for README.txt or README.md, Modules and Examples; when CHANGELOG and DaVinciResolveScript.pyi are present, use them for changes and method signatures.
The import name is DaVinciResolveScript. The wrapper in Modules and the native fusionscript library are different parts of the connection. Your installed README sets the applicable requirements; a public copy for another version provides orientation but does not replace it.
- Confirm that the directory belongs to the Resolve installation you launched, especially when more than one is installed.
- Read the Python requirements and external-access setup. Locate the installed module and its native-library path.
- Check scriptapp, GetProjectManager, GetCurrentProject and GetCurrentTimeline signatures; for GetName, identify whether the owner is a Project or Timeline.
| OS | SDK root |
|---|---|
| Windows | %PROGRAMDATA%\Blackmagic Design\DaVinci Resolve\Support\Developer\Scripting |
| macOS | /Library/Application Support/Blackmagic Design/DaVinci Resolve/Developer/Scripting |
| Linux | /opt/resolve/Developer/Scripting; some ISO installations use a different root, such as /home/resolve |
Prepare one specific external Python interpreter
For a short check in Studio 21.1's built-in Console, go straight to the next section: it needs neither a separate Python installation nor the environment variables shown here. This section prepares an external interpreter; the Console in 20.x follows its own release's SDK requirements.
In Studio, open Preferences → System → General → External Scripting Using and select Local for a script on this computer. None keeps the internal Console; Network concerns outside computers and is unnecessary for this exercise. Wait for Resolve to finish starting.
Distinguish three settings: RESOLVE_SCRIPT_API is the Scripting root, RESOLVE_SCRIPT_LIB names the fusionscript.dll or fusionscript.so file, and PYTHONPATH is Python's search path containing Scripting/Modules. RESOLVE_SCRIPT_API alone does not make an ordinary import work. This download uses normal importing, rather than the exact-path loader in the site's deeper connection guide.
The commands below affect only the current terminal and preserve an existing PYTHONPATH. Check the actual files first and adjust custom-installation paths. If your version's README describes launching a bundled interpreter externally, follow that route's instructions: manual variables may be unnecessary.
$env:RESOLVE_SCRIPT_API = Join-Path $env:PROGRAMDATA 'Blackmagic Design\DaVinci Resolve\Support\Developer\Scripting'
$env:RESOLVE_SCRIPT_LIB = 'C:\Program Files\Blackmagic Design\DaVinci Resolve\fusionscript.dll'
$env:PYTHONPATH = (Join-Path $env:RESOLVE_SCRIPT_API 'Modules') + $(if ($env:PYTHONPATH) { ';' + $env:PYTHONPATH } else { '' })
python -c "import sys, struct; print(sys.executable); print(sys.version); print(struct.calcsize('P') * 8)"export RESOLVE_SCRIPT_API='/Library/Application Support/Blackmagic Design/DaVinci Resolve/Developer/Scripting'
export RESOLVE_SCRIPT_LIB='/Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fusionscript.so'
export PYTHONPATH="$RESOLVE_SCRIPT_API/Modules${PYTHONPATH:+:$PYTHONPATH}"
python3 -c "import sys, struct; print(sys.executable); print(sys.version); print(struct.calcsize('P') * 8)"export RESOLVE_SCRIPT_API='/opt/resolve/Developer/Scripting'
export RESOLVE_SCRIPT_LIB='/opt/resolve/libs/Fusion/fusionscript.so'
export PYTHONPATH="$RESOLVE_SCRIPT_API/Modules${PYTHONPATH:+:$PYTHONPATH}"
python3 -c "import sys, struct; print(sys.executable); print(sys.version); print(struct.calcsize('P') * 8)"A short check inside the Console
Open Workspace → Console and choose a supported Python mode. The internal context and an outside terminal are different processes: this snippet uses the resolve object supplied by Resolve. Enter the lines in order; if the object or language mode is absent, return to the edition table and your build's documentation.
The output should show the product, full version and current project name, or No project is open. Do not paste Python into Lua mode. No Resolve object in this Console context means that the expected global is absent in this context; it does not test the external terminal's PYTHONPATH.
app = globals().get("resolve")
if app is None:
raise RuntimeError("No Resolve object in this Console context")
print(app.GetProductName(), app.GetVersionString())
manager = app.GetProjectManager()
if manager is None:
raise RuntimeError("ProjectManager is unavailable")
project = manager.GetCurrentProject()
print(project.GetName() if project is not None else "No project is open")Run the downloadable hello_resolve.py
Download the file to a separate working folder and read it: it uses only Python's standard library and Blackmagic's installed module. Use cd in the same configured terminal to enter the folder containing hello_resolve.py, then run the command below while Resolve is open. For the first positive check, manually open an existing practice project and its timeline.
The script checks module discovery, an explicitly configured library path, importing, the Resolve object, ProjectManager, project and timeline separately. Without RESOLVE_SCRIPT_LIB, native-library discovery is delegated to the installed module. A file existing is not proof that it loads; the next stage tests importing the wrapper and its dependencies.
python .\hello_resolve.py
$LASTEXITCODEpython3 ./hello_resolve.py
echo $?{
"status": "read_access_available",
"stage": "complete",
"product": "<product from your installation>",
"version": "<full version from your installation>",
"project_open": true,
"project_name": "<your current project>",
"timeline_checked": true,
"timeline_open": true,
"timeline_name": "<your current timeline>",
"exit_code": 0
}- Download hello_resolve.py
One file; its complete source is in this lesson's final section.
Application, project and timeline are separate results
GetName is called only on an existing Project or Timeline. Without a project, timeline_checked=false means no timeline query took place. Read timeline_open=false together with timeline_checked to distinguish those cases.
An open Project Manager window alone does not establish that the current project was unloaded. Inspect the returned object. A loaded project likewise does not guarantee an active timeline; the example never creates one automatically.
| Call | What a result establishes | When the object is absent |
|---|---|---|
| scriptapp("Resolve") | The application supplied an API object. | Stop at connection; do not call methods on None. |
| Resolve.GetProductName / GetVersionString | The running application's identity can be read. | This report requires non-empty strings. |
| Resolve.GetProjectManager() | A project-manager object is available. | A separate project_manager failure, not an import error. |
| ProjectManager.GetCurrentProject() | A project is currently loaded. | Valid empty state: project_open=false, exit code 0. |
| Project.GetCurrentTimeline() | That project has a current timeline. | With a project present: timeline_checked=true, timeline_open=false, exit code 0. |
Locate the first unsuccessful stage
status=failed comes with stage and exit_code. cause_type/cause_message retain the original exception when there is one. Read them together: ModuleNotFoundError inside a discovered wrapper can concern a dependency rather than DaVinciResolveScript itself. Change one setting and repeat the same command.
These codes belong to hello_resolve.py; the diagnostic tool in the deeper guide has its own contract. An absent current project or timeline does not produce a false failure code.
| Code / stage | What happened | What to inspect |
|---|---|---|
| 0 · complete | Read operations completed; a project or timeline may be absent. | project_open, timeline_checked and timeline_open, then names against the interface. |
| 10 · environment / module_discovery | Unsupported Python or no discovered module. | The executable, Python 3.8+, 64 bits and PYTHONPATH/Modules. Do not name your file DaVinciResolveScript.py. |
| 11 · library_path | An explicit RESOLVE_SCRIPT_LIB is not an existing absolute file. | The full .dll/.so name, literal quotes inside the value and the correct installation. |
| 12 · module_load | The wrapper was found, but importing or scriptapp is unavailable. | The cause, dependencies, architecture and Python version. DLL load failed does not prove the wrapper itself is missing. |
| 20 · connection | scriptapp returned no Resolve object or raised an exception. | Running Studio, completed startup, Local access and the process environment. |
| 21 · application_identity | Reading non-empty product/version failed. | Application state and whether the module belongs to the running installation. |
| 30 · project_manager | The manager is unavailable or its query failed. | Application stability; do not substitute automatic project creation. |
| 31 / 32 · current_project / current_timeline | A query or an existing object's name could not be read. | Whether the project/timeline closed during the read, the original exception and local method signature. |
Practice: verify your own installation
Completion means a reproducible report from your installation with matching names and an explanation of empty states. The JSON above illustrates its shape; it is not a recorded run on Resolve 20 or 21. The companion example is checked with API models; running it in your environment establishes native compatibility.
- Record the Resolve version/edition and the Python information command's output. Manually open an existing practice project and timeline, and note their names.
- Run hello_resolve.py. Compare exit_code=0, product/version, project_name and timeline_name with the interface; project_open and timeline_open should match the selected state.
- Run it again without changing the project. Check that it creates no project, clips or render jobs and does not switch timelines. This repeats the read check; it does not test writes.
- If you have a project with no timeline, open it manually and repeat: expect project_open=true, timeline_checked=true, timeline_open=false and exit code 0. Without such a project, do not mark this case as tested.
- After a successful import, you can test an unavailable application separately: save your own work, close Resolve manually and rerun the external script. Expect connection/20 if importing still succeeds; investigate any other stage independently.
- Record the command, exit code and result. When sharing a diagnostic report, remember that it contains project/timeline names and local paths.
Scripts folders and headless operation: later launch routes
Workspace → Scripts lists user scripts from directories specified by the local SDK. Utility holds general scripts; Comp/Tool concern Fusion, and page-specific folders have their own contexts. A file appearing in the menu does not establish language support in your edition.
Keep the external hello_resolve.py in an ordinary folder for this exercise. If you later move code to the internal menu, use its documented internal context and Console output; do not reuse shell logic containing SystemExit as a menu-script template.
| OS | Current user's folder |
|---|---|
| Windows | %APPDATA%\Blackmagic Design\DaVinci Resolve\Support\Fusion\Scripts |
| macOS | ~/Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/Scripts |
| Linux | $HOME/.local/share/DaVinciResolve/Fusion/Scripts |
Where the read check ends
Connecting this way does not create a protected read-only API mode. The script's contents define the boundary. This example obtains objects and reads names/version; it never calls CreateProject, LoadProject, SaveProject, ImportMedia, SetCurrentTimeline, AddRenderJob or StartRendering.
For a later script that changes state, choose a separate practice project, preserve the initial state and define the intended effect before running it. Check each return value and the interface result. Do not add writes to the probe to conceal None: first establish which object is actually missing.
- A connection does not verify every method documented in a different SDK release.
- Project.GetName and Timeline.GetName have different owners; access to one does not guarantee access to the other.
- MCP, network bridges and a Fusion connection are unnecessary for this local exercise and do not replace checking the direct Resolve API.
Next guides and the complete source
Once you can explain the report, continue with the dedicated connection and diagnostics guides. The complete source below matches the download; it is an authored probe, not part of Blackmagic's SDK.
"""Read the running Resolve application, current project and current timeline.
Run with the Python interpreter supported by your installed Scripting README.
Uses only the standard library and Blackmagic's installed DaVinciResolveScript.
No project-changing API calls, application launch, downloads or retries.
"""
import contextlib
import importlib
import importlib.util
import json
import os
from pathlib import Path
import platform
import struct
import sys
class ProbeError(RuntimeError):
def __init__(self, exit_code, stage, message):
super().__init__(message)
self.exit_code = exit_code
self.stage = stage
def load_api(checks):
"""Separate discovery, an explicit library path, and module loading."""
checks["python_version"] = platform.python_version()
checks["python_executable"] = sys.executable
checks["pointer_bits"] = struct.calcsize("P") * 8
checks["machine"] = platform.machine()
if sys.version_info < (3, 8) or checks["pointer_bits"] != 64:
raise ProbeError(10, "environment", "This example needs compatible 64-bit Python 3.8+.")
loaded = sys.modules.get("DaVinciResolveScript")
if loaded is not None:
checks["module_origin"] = getattr(loaded, "__file__", "already_loaded")
else:
try:
spec = importlib.util.find_spec("DaVinciResolveScript")
except Exception as exc:
raise ProbeError(10, "module_discovery", "Cannot discover the installed module.") from exc
if spec is None:
raise ProbeError(10, "module_discovery", "Module not found; check the interpreter and SDK Modules path.")
checks["module_origin"] = spec.origin
checks["module_found"] = True
library = os.environ.get("RESOLVE_SCRIPT_LIB")
if library is not None:
try:
valid = bool(library) and library == library.strip()
valid = valid and Path(library).is_absolute() and Path(library).is_file()
except (OSError, ValueError) as exc:
raise ProbeError(11, "library_path", "Cannot inspect RESOLVE_SCRIPT_LIB.") from exc
if not valid:
raise ProbeError(11, "library_path", "RESOLVE_SCRIPT_LIB must name an existing absolute library file.")
checks["library_path"] = "configured_file_found"
else:
checks["library_path"] = "managed_by_installed_module"
try:
api = importlib.import_module("DaVinciResolveScript")
if not callable(getattr(api, "scriptapp", None)):
raise TypeError("The loaded module has no callable scriptapp")
except Exception as exc:
raise ProbeError(12, "module_load", "Module found, but wrapper/native loading failed; inspect the cause.") from exc
checks["module_loaded"] = True
return api
def read_call(owner, method, stage, exit_code, *args):
try:
return getattr(owner, method)(*args)
except Exception as exc:
raise ProbeError(exit_code, stage, method + " failed.") from exc
def read_text(owner, method, stage, exit_code):
value = read_call(owner, method, stage, exit_code)
if not isinstance(value, str) or not value.strip():
raise ProbeError(exit_code, stage, method + " did not return a non-empty string.")
return value
def inspect_resolve(api):
"""All Resolve calls in this example are here; none changes a project."""
resolve = read_call(api, "scriptapp", "connection", 20, "Resolve")
if resolve is None:
raise ProbeError(20, "connection", "No Resolve object; check running Studio and Local scripting access.")
result = {
"status": "read_access_available",
"stage": "complete",
"product": read_text(resolve, "GetProductName", "application_identity", 21),
"version": read_text(resolve, "GetVersionString", "application_identity", 21),
"project_open": False,
"project_name": None,
"timeline_checked": False,
"timeline_open": False,
"timeline_name": None,
}
manager = read_call(resolve, "GetProjectManager", "project_manager", 30)
if manager is None:
raise ProbeError(30, "project_manager", "Resolve connected, but ProjectManager is unavailable.")
project = read_call(manager, "GetCurrentProject", "current_project", 31)
if project is None:
return result
result["project_open"] = True
result["project_name"] = read_text(project, "GetName", "current_project", 31)
timeline = read_call(project, "GetCurrentTimeline", "current_timeline", 32)
result["timeline_checked"] = True
if timeline is not None:
result["timeline_open"] = True
result["timeline_name"] = read_text(timeline, "GetName", "current_timeline", 32)
return result
def main():
checks = {}
try:
# Keep ordinary Python messages from the installed wrapper off JSON stdout.
with contextlib.redirect_stdout(sys.stderr):
api = load_api(checks)
result = inspect_resolve(api)
code = 0
except ProbeError as exc:
code = exc.exit_code
result = {"status": "failed", "stage": exc.stage, "message": str(exc)}
if exc.__cause__ is not None:
result["cause_type"] = type(exc.__cause__).__name__
result["cause_message"] = str(exc.__cause__)
result["exit_code"] = code
result["checks"] = checks
# ASCII escapes also work in terminals that cannot display a project's name.
print(json.dumps(result, ensure_ascii=True, indent=2, allow_nan=False))
return code
if __name__ == "__main__":
raise SystemExit(main())
- Connect Python to Resolve API
An exact-path loader for the official file, environment requirements and application identity reads.
- Diagnose Scripting API availability
An extended report with its own exit-code contract; project names are omitted by default.
- Download hello_resolve.py
The same source text available to copy below.
Key takeaway
The first useful result is an understandable report from your installation: the module is found, the application answers, and current project and timeline availability are checked separately. Then choose the next operation and define what would count as success.
Sources and version notes
- Blackmagic — DaVinci Resolve 21.1 release notes
Notes: Python scripting moves to Studio. This is the 21.1 change, not a description of every 20.x release.
- Blackmagic — DaVinci Resolve Studio 21.1 release notes
Scripting API: built-in Python for the Console and the end of Python 2 support.
- Blackmagic — Studio and iPad Features 21.1
September 2026: Scripting API on page 4 and the Mac App Store restriction in footnote 7 on page 11.
- Blackmagic — Resolve 21.1 Reference Manual
Chapter 1, The Console; Chapter 4, System and User Preferences → General → External Scripting Using. An interface illustration alone does not establish Python availability in Free.
- Blackmagic Scripting README — published 21.0.4 copy
Blackmagic's original README dated 24 July 2026, mirrored by X-Raym: basic methods and common paths. Use your installed README.txt/README.md, CHANGELOG and .pyi for your release; older Python requirements do not override 21.1 changes.
- Python — importlib
Module discovery and importing are separate operations. Finding a spec does not prove that a native dependency loads.