Python scripting in Resolve 15

A place for feedback and discussion on DaVinci Resolve 15
  • Author
  • Message
Offline
User avatar

Nick Shaw

  • Posts: 205
  • Joined: Thu Sep 13, 2012 11:43 am
  • Location: London, UK

Python scripting in Resolve 15

PostMon Apr 16, 2018 12:28 pm

Is this the right place to look for help on Resolve scripting?

I am a bit of a noob to this, so I may well be doing something stupid.

Code: Select all
DaVinciResolveScript.scriptapp("Resolve")
returns a None object, so I can't then do anything with it.
Code: Select all
AttributeError: 'NoneType' object has no attribute 'GetProjectManager'

The example scripts fail for this same reason.

However,
Code: Select all
DaVinciResolveScript.scriptapp("Fusion")
returns a FusionUI object, so the module would appear to have loaded.

I do get a bunch of warnings when importing the module:
Code: Select all
dyld: warning, LC_RPATH @executable_path/../Libraries/Fusion in /Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fusionscript.so being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/. in /Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fusionscript.so being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Frameworks in /Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/libluajit-5.1.2.dylib being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Libraries/Fusion in /Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/libluajit-5.1.2.dylib being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/. in /Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/libluajit-5.1.2.dylib being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Libraries/Fusion in /Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fusionscript.so being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/. in /Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fusionscript.so being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Libraries/Fusion in /Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fusionscript.so being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/. in /Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fusionscript.so being ignored in restricted program because of @executable_path
Workflow Consultant, London UK
LUTs and LUT plugins
www.antlerpost.com/plugins
Offline
User avatar

Nick Shaw

  • Posts: 205
  • Joined: Thu Sep 13, 2012 11:43 am
  • Location: London, UK

Re: Python scripting in Resolve 15

PostTue Apr 17, 2018 11:06 am

Update, I got the errors mentioned above when trying to use scripting through a standard Terminal Python shell (under OS X) but when I run fuscript in interactive mode I have more success (/Applications/DaVinci\ Resolve/DaVinci\ Resolve.app/Contents/Libraries/Fusion/fuscript -l py2 -i). I discovered this via a post on steakunderwater.com although I can't see any mention of fuscript in the Resolve scripting README.

I'm sure yesterday I had the same problems using the console within Resolve, but today it seems to work! So maybe I missed something yesterday.

I am able to work through the steps from the 1_sorted_timeline_from_folder.py example script, and it seems mainly to work. I can create a project and add the clips to a timeline. There are a few things I am still unsure of, but I am feeling my way, and it may well be user error.

project.SetResolution(2048, 1152) sets the Timeline Resolution (as shown in the Project Settings panel) to 2048x1152, but then running timeline = mediapool.CreateEmptyTimeline("Test Timeline 1") creates a new timeline which is still 1920x1080, per defaults. But if the resolution is set via scripting, creating a new timeline by pressing CMD-N also produces a 1080p timeline, so maybe there is somewhere else that I need to set it to 2k as well.

project.SetFrameRate(25) sets the timeline framerate to 25, but the Playback Framerate stays at the default 24, and I can't find a way of setting that via scripting.

If this is a bug, I was just luck that a chose a folder of 2kp25 clips to test with. If they had been 1080p24, I would not have noticed.
Workflow Consultant, London UK
LUTs and LUT plugins
www.antlerpost.com/plugins
Offline
User avatar

Nick Shaw

  • Posts: 205
  • Joined: Thu Sep 13, 2012 11:43 am
  • Location: London, UK

Re: Python scripting in Resolve 15

PostTue Apr 17, 2018 11:50 am

…and now it works in a standard Python shell in Terminal as well!

Maybe it's because I restarted the machine. Maybe it's because I ran fuscript first. Who knows, but it works!

I can still only create a 1080p timeline that plays back at 24fps, but it's a good start.

Onwards and upwards!
Workflow Consultant, London UK
LUTs and LUT plugins
www.antlerpost.com/plugins
Offline
User avatar

Nick Shaw

  • Posts: 205
  • Joined: Thu Sep 13, 2012 11:43 am
  • Location: London, UK

Re: Python scripting in Resolve 15

PostMon Apr 23, 2018 3:25 pm

Has anybody found out if there are any methods enabled in Resolve scripting which are not listed in the ReadMe? Particularly ones for rendering.
Workflow Consultant, London UK
LUTs and LUT plugins
www.antlerpost.com/plugins

Return to DaVinci Resolve 15 Beta

Who is online

Users browsing this forum: No registered users and 3 guests