Meanwhile this post was approved I somehow luckily found something that seems to be a solution on some other forum.
If I include
- Code: Select all
import imp
lib = r'C:\Program Files\Blackmagic Design\DaVinci Resolve\fusionscript.dll'
dvr_script = imp.load_dynamic('fusionscript', lib)
resolve = dvr_script.scriptapp("Resolve")
fusion = resolve.Fusion()
projectManager = resolve.GetProjectManager()
in the beginning of any Python file, I am able to script. That counts also for DaVinciResolveScript.py - code itself doesn´t work for me, but if I include code uphere at the beginning, it works and returns this:
- Code: Select all
C:\Users\MADCAT\PycharmProjects\pythonProject\venv\Scripts\python.exe C:/Users/MADCAT/PycharmProjects/pythonProject/main.py
Resolve (0x00007FF66AEC0950) [App: 'Resolve' on 127.0.0.1, UUID: 9b740213-f197-4bbc-85bd-9e6efcdf4b9c]
I am not sure if this is correct way it should work, but from first testing, it does. Tried to create new project using script, new folder, etc.
Also funny thing to mention, while I was stuck I tried to install Python 2.7 aswell and that thing installed together with Python 3.6 enabled option "Fusion settings → Script → Default Python version 2.7" to be set on Python 3.6. No idea why I can´t just have Python 3.6 and Resolve recognizes it as default, not greying out option to choose it.
PyCharm editor also works using that "hack" code mentioned above.
Anyway I would like to know if this is correct way to continue, including code above in the beginning of every script or it´s just part solution and I will come to some problem using it later on.