Page 1 of 1

GetResolve returns None for internal scripts

PostPosted: Wed May 31, 2023 4:07 pm
by gregory_01
Hi,

I have tried to run a script in Davinci resolve by putting it under the folder "Blackmagic Design\DaVinci Resolve\Fusion\Scripts\Utility" and by accessing it in the Davinci resolve app (Workspace -> Scripts)

Unfortunately, the GetResolve() method returns none, and I struggle to understand why. I use the free version, but as I understand it, the script should work if it is run with the app.

I am on Windows.

Here is the script:
Code: Select all
import os
from python_get_resolve import GetResolve


api = os.getenv('RESOLVE_SCRIPT_API')
lib = os.getenv('RESOLVE_SCRIPT_LIB')
path = os.getenv('PYTHONPATH')
print('RESOLVE_SCRIPT_API: ' + api)
print('RESOLVE_SCRIPT_LIB: ' + lib)
print('PYTHONPATH: ' + path)

resolve = GetResolve()
print(resolve)


Here is the result in the console:

Code: Select all
RESOLVE_SCRIPT_API: C:\ProgramData\Blackmagic Design\DaVinci Resolve\Support\Developer\Scripting;C:\ProgramData\Blackmagic Design\DaVinci Resolve\Support\Developer\Scripting

RESOLVE_SCRIPT_LIB: C:\Program Files\Blackmagic Design\DaVinci Resolve\fusionscript.dll

PYTHONPATH: %PYTHONPATH%;%RESOLVE_SCRIPT_API%\Modules\;C:\ProgramData\Blackmagic Design\DaVinci Resolve\Support\Developer\Scripting\Modules

None


Many thanks in advance

Re: GetResolve returns None for internal scripts

PostPosted: Thu Jun 01, 2023 1:12 am
by Andrew Hazelden
gregory_01 wrote:I use the free version, but as I understand it, the script should work if it is run with the app.


Try using this instead:
Code: Select all
resolve = app.GetResolve()

Re: GetResolve returns None for internal scripts

PostPosted: Thu Jun 01, 2023 11:00 am
by gregory_01
Thanks, it worked

Re: GetResolve returns None for internal scripts

PostPosted: Thu Jun 01, 2023 8:06 pm
by Igor Riđanović
You don't need to make the resolve instance when running scripts internally. Your entire script can be simplified to this:
Code: Select all
print(resolve)