Page 1 of 1

Need to get External Python Script to Resolve working

PostPosted: Thu Jul 01, 2021 4:03 pm
by julanH
We are trying to interact with Resolve / Fusion from an external python script.

Fusion Studio 9
DaVinci Resolve 15
Python 2.7.15
Python 3.9.5

We have read the README.txt provided here
C:\ProgramData\Blackmagic Design\DaVinci Resolve\Support\Developer\Scripting\README.txt

This document mentions setting up some Environment variables - which we have done and tested they are set correctly.

It then gives a sample script
Code: Select all
#!/usr/bin/env python
import DaVinciResolveScript as dvr_script
resolve = dvr_script.scriptapp("Resolve")
fusion = resolve.Fusion()
projectManager = resolve.GetProjectManager()
projectManager.CreateProject("Hello World")


In addition there are sample scripts provided here
C:\ProgramData\Blackmagic Design\DaVinci Resolve\Support\Developer\Scripting\Examples

When we try to run these through FuScript it does not work.
If we put a print of the resolve variable after the scriptapp("Resolve") call we get
None
If we change
Code: Select all
resolve = dvr_script.scriptapp("Resolve")

To
Code: Select all
fusion = dvr_script.scriptapp("Fusion")

and print the fusion var we get
FusionUI (0x0000000002C3D5C0) [App: 'Fusion' on 127.0.0.1, UUID: 6059386d-18e4-4a44-bbb2-f04de2576fcd]

But any attempt to do anything else with the fusion object results in

TypeError: 'NoneType' object is not callable

I believe we are missing something trivial but fundamental.

If anyone could provide insight / direction on how to fix this - we would greatly appreciate it.

Re: Need to get External Python Script to Resolve working

PostPosted: Fri Jul 02, 2021 3:34 am
by Peter Chamberlain
Do you have the Studio version?

Re: Need to get External Python Script to Resolve working

PostPosted: Fri Jul 02, 2021 4:07 am
by Shrinivas Ramani
Hi

Resolve supports Python versions 2.7 and 3.6 - please check with the official installers from https://www.python.org/downloads/

Regards
Shrinivas

Re: Need to get External Python Script to Resolve working

PostPosted: Fri Jul 02, 2021 1:15 pm
by julanH
Peter Chamberlain wrote:Do you have the Studio version?

Of Fusion? Yes Fusion Studio 9
from the Help / About menu

Fusion Studio for Windows
Version: 9.02 Build 15

Re: Need to get External Python Script to Resolve working

PostPosted: Fri Jul 02, 2021 1:22 pm
by julanH
Shrinivas Ramani wrote:Hi

Resolve supports Python versions 2.7 and 3.6 - please check with the official installers from

Regards
Shrinivas


@Shrinivas we have both 2.7.15 and 3.9 - tried with both - same results.
When we try with the Console and select Py2 and type the instructions in manually from within Resolve - we get the same problem.

Re: Need to get External Python Script to Resolve working

PostPosted: Fri Jul 02, 2021 11:21 pm
by Igor Riđanović
Are you on Synology NAS?