Resolve scripting - On Mac Using Python

Get answers to your questions about color grading, editing and finishing with DaVinci Resolve.
  • Author
  • Message
Offline

Steve Swisz

  • Posts: 66
  • Joined: Tue Aug 11, 2015 1:51 am

Resolve scripting - On Mac Using Python

PostFri Apr 05, 2019 12:56 am

I hope that I am doing something wrong and that this is simple fix.
We are using 15.3 trying to add and use Python scripts on both Studio Paid version and also the Free Version.

MAC OSX - I forget what Ver OS we are on but it is update.
Python - 2.7

I have gone back and forth Igor Riđanović, he has some cooked up some awesome Python apps and workflows in Resolve.

Problem is when we try to run Python scripts we are getting tons of errors, could it be the Free Version since that is always a station we have access to test on?
We have re-installed the Resolve Soft. and Python, but we get msg like Attribute Error, and Object has not Attribute. But we have typed in the exact same code from the README sheet as well as from Igor and still a few lines will work but cannot get to a point where we can start setting up the scripts to tasks for us.
So if any of you can or have had success on MAC, scripting with Python please help us out.

Thanks,
Offline
User avatar

Igor Riđanović

  • Posts: 1596
  • Joined: Thu Jul 02, 2015 5:11 am
  • Location: Los Angeles, Calif.

Re: Resolve scripting - On Mac Using Python

PostFri Apr 05, 2019 2:22 am

I think the free Resolve will only allow you to use the internal console to execute scripts. I have never tried the free version so I can't say for sure.

Which Python are you using? The one that's shipping with the OS, a Brew package, etc.?
www.metafide.com - DaVinci Resolve™ Apps
Offline

Steve Swisz

  • Posts: 66
  • Joined: Tue Aug 11, 2015 1:51 am

Re: Resolve scripting - On Mac Using Python

PostFri Apr 05, 2019 5:28 pm

Hello again Igor, funny I thought of just emailing you directly but thought others could benefit from this thread.
We are using the OS python, we will try again on both the paid and free version. Hard to get on the paid version here always in use or rooms are booked.
Offline
User avatar

Igor Riđanović

  • Posts: 1596
  • Joined: Thu Jul 02, 2015 5:11 am
  • Location: Los Angeles, Calif.

Re: Resolve scripting - On Mac Using Python

PostFri Apr 05, 2019 7:25 pm

You don't really need the access to the machine's desktop. Just SSH into the machine while the colorist is using it. As long as you don't attempt changing anything via the API you can poke around all you want. The impact is minimal.
www.metafide.com - DaVinci Resolve™ Apps
Offline

Steve Swisz

  • Posts: 66
  • Joined: Tue Aug 11, 2015 1:51 am

Re: Resolve scripting - On Mac Using Python

PostTue Apr 09, 2019 3:30 pm

Yeah I aware of being able to access through SSH, but the rooms/stations are in use, that is why we suse the free version to test new ideas and workflows on.
Offline
User avatar

Antoine Grasset

  • Posts: 157
  • Joined: Sat Mar 14, 2015 7:05 pm
  • Location: Paris, France

Re: Resolve scripting - On Mac Using Python

PostFri Jan 24, 2020 12:50 pm

Hello,
did you find a way to make it work properly with the native Mac Python 2.7 ?

I'm still getting errors :
when running from the Resolve/Fusion Console, "Unable to find module DaVinciResolveScript from $PYTHONPATH - trying default locations"
when running from Sublime : "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" (and several other that looks the same)
Offline

Frank Engel

  • Posts: 928
  • Joined: Thu May 17, 2018 11:09 pm
  • Real Name: Frank Engel

Re: Resolve scripting - On Mac Using Python

PostFri Jan 24, 2020 2:41 pm

At least some of the scripting support is limited to the non-app-store version of Resolve Studio:

https://documents.blackmagicdesign.com/ ... arison.pdf
Offline
User avatar

Antoine Grasset

  • Posts: 157
  • Joined: Sat Mar 14, 2015 7:05 pm
  • Location: Paris, France

Re: Resolve scripting - On Mac Using Python

PostFri Jan 24, 2020 2:45 pm

Frank Engel wrote:At least some of the scripting support is limited to the non-app-store version of Resolve Studio:

https://documents.blackmagicdesign.com/ ... arison.pdf

I'm using Resolve STUDIO 16.1.2, so that shouldn't be a problem
Offline
User avatar

Gary Hango

  • Posts: 886
  • Joined: Mon Apr 09, 2018 10:35 pm
  • Location: Left Coast
  • Real Name: Gary Hango

Re: Resolve scripting - On Mac Using Python

PostFri Jan 24, 2020 3:30 pm

It’s my understanding that scripting is not available at all in the free version.
Microsoft Windows 10 Pro x64
Intel(R) Core(TM) i7-6700, 3.40GHz, 32.0 GB
MB: MSI, BIOS: American Megatrends Inc. A.60, 12/17/2015
NVIDIA GeForce GTX 960, 2Gb
Resolve 18.1.1.0007(Free)
Offline

Shrinivas Ramani

Blackmagic Design

  • Posts: 2729
  • Joined: Wed Sep 20, 2017 10:19 am

Re: Resolve scripting - On Mac Using Python

PostSat Jan 25, 2020 7:23 am

Script access from outside the application is limited to the Studio version. The free version can still use the Fusion Console or load scripts from the menus.

The developer documentation from the Help menu has a read-me in the scripting folder that identifies the various paths, variables and utilities for Resolve. A formatted version of the same has also been created by users here: viewtopic.php?f=21&t=99270
Offline

Abdelrahman Magdy

  • Posts: 291
  • Joined: Fri Jan 23, 2015 10:08 pm

Re: Resolve scripting - On Mac Using Python

PostWed Mar 11, 2020 3:31 am

Shrinivas Ramani wrote:Script access from outside the application is limited to the Studio version. The free version can still use the Fusion Console or load scripts from the menus.

The developer documentation from the Help menu has a read-me in the scripting folder that identifies the various paths, variables and utilities for Resolve. A formatted version of the same has also been created by users here: viewtopic.php?f=21&t=99270


Hi Shrinivas. I am having trouble running my Lua scripts from the menus in the free version of Resolve.

Take the following code for instance:

Code: Select all
resolve = Resolve()
print(resolve)


When I run it in the console, this is the output I get:

Code: Select all
Resolve (0x00007FF73872C260) [App: 'Fusion' on 127.0.0.1, UUID: 7110f6c8-df72-4a32-b04f-e26b9122dcf8]


But when I try running it from Workspace > Scripts, it prints true.

I thought running scripts from the menus is supported in the free version or did I misunderstand.
System specs:
Resolve Studio version: 16.1.0.055
Fusion Studio version: 9.0.2
OS: CentOS 7
CPU: Intel i7-4790k 4GHz Quad-Core
RAM: 32GB
GPU: NVIDIA GeForce 1080 Ti 11GB
Offline

Shrinivas Ramani

Blackmagic Design

  • Posts: 2729
  • Joined: Wed Sep 20, 2017 10:19 am

Re: Resolve scripting - On Mac Using Python

PostWed Mar 11, 2020 6:09 am

I pasted the two lines in a test script under Fusion/Comps folder.
And ran them both from the scripts and the Console (DaVinci Resolve 16.1.2 free) and got identical results.
Screen Shot 2020-03-11 at 2.04.34 PM.png
Screen Shot 2020-03-11 at 2.04.34 PM.png (346.11 KiB) Viewed 2949 times
Code: Select all
$ cat ~/Library/Application\ Support/Blackmagic\ Design/DaVinci\ Resolve/Fusion/Scripts/Comp/Abdel_lite_test.lua
resolve = Resolve()
print(resolve)
Can you check if there's another issue at hand?
Offline
User avatar

roger.magnusson

  • Posts: 3398
  • Joined: Wed Sep 23, 2015 4:58 pm

Re: Resolve scripting - On Mac Using Python

PostWed Mar 11, 2020 11:37 am

Shrinivas, are you sure that's the free version? Not installed in parallel with the Studio version?

I too had issues with this and just thought it wasn't meant to work. I have since found that the Class Browser for Resolve I made a while ago does indeed run from the script menu in the free version. That's because it doesn't use Fusion() or Resolve() to get the scriptapp reference, but simply "app".

To get a reference to the Resolve scriptapp, use app:GetResolve(). That seems to work in the free version. Found it using the Class Browser of course. :)
Offline

Abdelrahman Magdy

  • Posts: 291
  • Joined: Fri Jan 23, 2015 10:08 pm

Re: Resolve scripting - On Mac Using Python

PostWed Mar 11, 2020 12:07 pm

roger.magnusson wrote:Shrinivas, are you sure that's the free version? Not installed in parallel with the Studio version?

I too had issues with this and just thought it wasn't meant to work. I have since found that the Class Browser for Resolve I made a while ago does indeed run from the script menu in the free version. That's because it doesn't use Fusion() or Resolve() to get the scriptapp reference, but simply "app".

To get a reference to the Resolve scriptapp, use app:GetResolve(). That seems to work in the free version. Found it using the Class Browser of course. :)
Roger, you sir are brilliant :). app:GetResolve() works. That is all I need for now. Thank you very much.

Out of curiosity, Roger, how did you manage to find that using the Class Browser? I have it installed, but it doesn't include any reference to 'app' or the 'GetResolve' method.
System specs:
Resolve Studio version: 16.1.0.055
Fusion Studio version: 9.0.2
OS: CentOS 7
CPU: Intel i7-4790k 4GHz Quad-Core
RAM: 32GB
GPU: NVIDIA GeForce 1080 Ti 11GB
Offline
User avatar

roger.magnusson

  • Posts: 3398
  • Joined: Wed Sep 23, 2015 4:58 pm

Re: Resolve scripting - On Mac Using Python

PostWed Mar 11, 2020 2:37 pm

The Fusion class has the GetResolve() method (also inherited by the FusionUI class). "app" is an instance of the FusionUI class.

Don't really recall where i found "app" though. Might have been by looking at the Fusion registry. I've also spent a lot of time looking at the fuscript.dll/fuscript.so binaries that contain some of the bundled functionality in plain text.

Note that "app" only works inside Resolve. If you were to make a script for Resolve Studio started outside Resolve using the fuscript executable it wouldn't work.
Offline

b2hstudios

  • Posts: 3
  • Joined: Wed Oct 30, 2013 12:38 pm

Re: Resolve scripting - On Mac Using Python

PostWed Mar 11, 2020 4:06 pm

Hello Igor, How write a script for Render individuals clips with custom name array.

As Reslove will not allow us to render clips individually with custom name automatically. Usually it will render in Event Version seq.


Sent from my iPad using Tapatalk
Offline
User avatar

Igor Riđanović

  • Posts: 1596
  • Joined: Thu Jul 02, 2015 5:11 am
  • Location: Los Angeles, Calif.

Re: Resolve scripting - On Mac Using Python

PostTue Mar 24, 2020 6:19 am

You can iterate all video track in a timeline and look for item names. When you find a name that matches the name in your custom name array you render the clip. But consider that the timeline item name is inherited from the bin clip name. A timeline could have any number of items with the same name and all of them would be found in the search. This may or may not be the behavior you seek.
www.metafide.com - DaVinci Resolve™ Apps

Return to DaVinci Resolve

Who is online

Users browsing this forum: Ask Jeeves [Bot], Bing [Bot], Google [Bot] and 149 guests