Access Resolve via Python without 'module not found' and endless attmpts to make the environment variables work.
#davinci_resolve_python_wo_crappy_environment_variables_9hole
import os
import sys
# Add the path to the DaVinciResolveScript.py file to the PYTHONPATH
sys.path.append("C:/ProgramData/Blackmagic Design/DaVinci Resolve/Support/Developer/Scripting/Modules")
# Set the RESOLVE_SCRIPT_API_NET environment variable
os.environ["RESOLVE_SCRIPT_API_NET"] = "1"
# Import the DaVinci Resolve Python API
import DaVinciResolveScript as dvr
resolve = dvr.scriptapp("Resolve")
project_manager = resolve.GetProjectManager()
project = project_manager.CreateProject("Test_Project")
if project:
print("New project created successfully.")
else:
print("Failed to create a new project.")
Add files from a specified folder to media and add each to a track named same as part of their clipname/filename