Using Python and Expanding Resolve’s Functionality

November 7, 2018

Resolve's new scripting APIs open up exciting new possibilities. Learn how to get started by using Python to import comments from Frame.io.


Series

April 2019 Update: In DaVinci Resolve 16, Frame.io markers are directly integrated into Resolve. But this Insight is still an excellent introduction into using Python to extend the functionality of DaVinci Resolve.


Importing Frame.io Markers With Your Own Homebrew Import Script

One of the most exciting things about Resolve 15’s new Fusion integration is the fact that it added Python scripting to Resolve. This has huge potential to open up Resolve to exciting new workflows and functionality. In this Insight, I’ll walk you through how to install and configure Python for scripting in Resolve, and give you a taste of the power python scripting opens up.

Configuring Your System For Python And Resolve

To use Python with Resolve, you’ll need to configure a few environment variables first.

After installing python, you’ll need to set a few environment variables for Python and Resolve to work together. I’ll walk you through the process in windows, but the Resolve Developer Documentation has info for Mac OS and Linux as well. Blackmagic also includes a set of example scripts you can look at for reference.

Importing Client Notes From Frame.io

Recently, Robbie wrote an Insight on how to speed up your grading workflow. While he was writing it – he challenged me to figure out a way to get frame.io comments to import in Resolve. Since I love a challenge (and I thought this would make for a great tool that I would use a lot in my grading work) I jumped at the chance and got to scripting. I’ve included the script for members to use themselves. (and a big thanks to my brother, Larry D’Anna – who helped me with the CSV parsing code used in the script)

Errata

Python 3.6 (not Python 3.7): In the video, I state that Resolve expects Python 3.7. This is incorrect! Resolve expects Python 3.6.

Member Content

Sorry... the rest of this content is for members only. You'll need to login or sign up to continue (we hope you do!).

Membership options
Member Login

Comments

Homepage Forums Using Python and Expanding Resolve’s Functionality

Viewing 14 reply threads

    • Sakip Kaan H
      Guest

      Joey,

      Firstly, thank you for that great insight.
      When I heard there will be Python support in Resolve, I was so excited and started to learn it. I learn some fundementals and got familiar with syntax but since I’m really new in this subject I didn’t get it how to set up the scripting function in Resolve. There was a video about that in YouTube but I really don’t get it..

      I think Python scripting opens new horizons in terms of automation. My first idea was to build a script for exporting clips which going to VFX. I’m working myself mostly and I do a lot of online editing work. It’s so annoying to write all these timecodes, than mark them and give export. I want write a script I can write timecodes in it and let the Resolve do the rest…

      I will definitely check the the learning resources you choose… It came a little abstract while I was learning (I used Lynda a lot) now I can open and try things in it. I hope that will help to my learning curve. Please please enlight us about Python and possibilities of it…


    • Joey D’Anna
      Guest

      Thanks! yea im really exited to see the API mature and add more functionality. I’m still early into learning python myself – so I like to lean heavily on looking at examples and taking bits and pieces from them.

      In that examples folder that comes with resolve – there’s actually a script that adds timelines to the render queue. that may be a good jumping off point for what you have in mind. Looking at the API reference – you can adjust mark in and mark out points of renders in script.


    • Greg Greenhaw
      Guest

      It would be great if they fully built out the api to all color controls then it would really open up the ability to build custom control surfaces beyond having to use screen size dependent mouse controlling software.


    • Joey D’Anna
      Guest

      Yea I would love that. The more things that are scriptable, the better!


    • Tim Whiting
      Guest

      Is there any reason that I am unable to add multiple paths to the environment variable? My box is much more simplified


    • Joey D’Anna
      Guest

      separate the paths with semicolons when you first enter it. Once you do that, if you click “edit” – then it will show you the multiple path dialog.


    • Seth Goldin
      Guest

      Wonderful! Thank you so much for this. Would also love additional insights that cover setup for Mac and Linux.


    • Joey D’Anna
      Guest

      Thanks!

      On mac or linux you need to set the environment variables in your .profile file.
      so in a text editor, open ~/.profile

      and on mac add:

      
      export RESOLVE_SCRIPT_API="/Library/Application Support/Blackmagic Design/DaVinci Resolve/Developer/Scripting/"
      export RESOLVE_SCRIPT_LIB="/Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fusionscript.so"
      export PYTHONPATH="$PYTHONPATH:$RESOLVE_SCRIPT_API/Modules/"
      

      then log off and log back on.

      on linux, it would be:

      
      export RESOLVE_SCRIPT_API="/opt/resolve/Developer/Scripting/"
      export RESOLVE_SCRIPT_LIB="/opt/resolve/libs/Fusion/fusionscript.so"
      export PYTHONPATH="$PYTHONPATH:$RESOLVE_SCRIPT_API/Modules/"
      

      if you didn’t already have a ~/.profile file – make sure you make it executable after creating it by running:

      
      chmod a+x ~/.profile
      

      (note – i haven’t tested this. this is just based on the paths listed in the readme.txt file)


    • Joey D’Anna
      Guest

      Hey Everyone – just a quick note, a member reached out to me having trouble with the script example. Turns out having eomji characters in your frame.io profile or comment was causing errors – so I’ve updated the download link to a new version that strips those characters out.


    • Seth Goldin
      Guest

      Excellent! Will give this a shot!


    • Joey D’Anna
      Guest

      Hey guys – one more quick note – I made an error in this insight and said to install the latest version of Python (which is 3.7) – Resolve actually is expecting 3.6, so if you are going to use python3 – Install the latest 3.6 version, not the latest 3.7


    • Pat Inhofer
      Guest

      This Insight has been updated with a new version of the Python script which can handle Replies to comments in Frame.io.


    • Edoardo R
      Guest

      Hi !

      Sorry could you explain a little bit more how to set the environment variables on MAC ? I could not find any .profile file…

      Thank you,
      E


    • Joey D’Anna
      Guest

      If you don’t have a .profile file (in your user’s home directory) – you can just create one. (run touch ~/.profile)

      then you can open it in a text editor and add the export lines to set the envirnoment variables.


    • George C
      Participant

      Has anyone had issues importing Tkinter? I’m on 3.6.8 and am getting ModuleNotFound errors calling it out in the console. Thanks!

      • This reply was modified 2 weeks, 3 days ago by George C. Reason: Whoops - wrong Insight

      • Joey D’Anna
        Participant

        Yea its a bit more of a hassle to use on Python 3. Can you try switching back to Python2? theres a setting for it in fusion prefs.
        There are better ways to do UIs in Resolve scripts – I just haven’t learned them yet. Evenutally I want to update all my scripts with much nicer UIs.


        • George C
          Participant

          Ah – yea that looks like it addressed the problem. Interesting, and thanks for the quick assist!

Viewing 14 reply threads
  • You must be logged in to reply to this topic.

Hundreds of Free Tutorials

Get full access to our entire library of 900+ color tutorials for an entire week!


Start Your Free Trial
Loading...