Can I assign a script to a key?

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

daktulus

  • Posts: 170
  • Joined: Wed Sep 04, 2019 11:07 am
  • Real Name: Harro Zimmer

Can I assign a script to a key?

PostSat Aug 01, 2020 10:01 pm

I want to export a .drp by just pressing a key e.g. F5.

This would be perfect to save the different states of a project and it would save a lot of time.

Igor wrote a script to export a .drp:

Igor Riđanović wrote:
You can save DRPs with this script:
Code: Select all
pm = resolve.GetProjectManager()
proj = pm.GetCurrentProject()
projName = proj.GetName()
if pm.ExportProject(projName, 'D:\\' + projName):
    print 'Exported', projName

This will save to a Windows D: drive. Change this path to suit your needs. The DRP name will reflect the name of the project. If you want to save incremental stages of your project you can append projName with a timestamp.


But he wasn´t sure if key binding with a script is possible in Resolve.

Igor Riđanović wrote:You can't do key binding in the Resolve API. I'm not sure if something like that exists in the Fusion scripting. The only way I would know how to get the F5 trigger going is by running this as an external script, like a little app that's always on waiting for an F5 key press.


Is assigning a script to a key possible?
Maybe in Fusion?
Offline
User avatar

Igor Riđanović

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

Re: Can I assign a script to a key?

PostSun Aug 02, 2020 6:59 am

An easier solution would be to run the script like a minimal external app. You'd just temporarily switch to the app, hit F5, and go back to Resolve.

There may be some third party macro recorder tools that replicate mouse menu selection when triggered. This strikes me as not the best way to solve this though.
www.metafide.com - DaVinci Resolve™ Apps
Offline

Ryan Bloomer

  • Posts: 372
  • Joined: Tue Jul 09, 2013 6:58 pm

Re: Can I assign a script to a key?

PostSun Aug 02, 2020 2:42 pm

one solution could be to map "export project..." to F5 in the keyboard customization. It is currently defaulted to "ctrl + e" if you're using the DaVinci default keyboard shortcuts.
Offline

John Paines

  • Posts: 3797
  • Joined: Tue Jul 28, 2015 4:04 pm

Re: Can I assign a script to a key?

PostSun Aug 02, 2020 2:51 pm

Ctrl-e seems sufficient to me, but this will never work as a single keystroke because the act of creating and saving a .drp either overwrites the prior .drp in the default location (for which you're prompted) or you need to manually enter a new file name to retain prior versions. Without more exotic code -- automatic sequential naming, or forced overwrites if that's what's wanted -- a single keystroke won't solve anything.
Offline
User avatar

Igor Riđanović

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

Re: Can I assign a script to a key?

PostSun Aug 02, 2020 5:18 pm

Overwriting an existing DRP can be easily solved by deploying a small Bash or Batch script that looks at a directory and as soon as there is a DRP file in the directory it moves the file to another directory and renames it with a time stamp.
www.metafide.com - DaVinci Resolve™ Apps
Offline

Jason Conrad

  • Posts: 301
  • Joined: Wed Aug 16, 2017 3:23 pm

Re: Can I assign a script to a key?

PostSun Aug 02, 2020 9:48 pm

Keyboard Maestro for Mac. Autohotkey for windows.
-MacBook Pro (14,3) i7 2.9 GHz 16 GB, Intel 630, AMD 560 x1
-[DR 16.2.5.015]
Offline

daktulus

  • Posts: 170
  • Joined: Wed Sep 04, 2019 11:07 am
  • Real Name: Harro Zimmer

Re: Can I assign a script to a key?

PostMon Aug 03, 2020 1:17 am

Igor Riđanović wrote:Overwriting an existing DRP can be easily solved by deploying a small Bash or Batch script that looks at a directory and as soon as there is a DRP file in the directory it moves the file to another directory and renames it with a time stamp.


This would be a great solution, because what is annoying is not hitting the key to open export, but that you have to type in a new name with date etc. all the time.

I already mapped F5 to open "export project" in keyboard customization.
If you write a script that adds a timestamp automatically, everytime a .drp is saved (instead of overwrting the old .drp) this would be the solution.
You just need to hit F5 and Enter then.

Perfect would be, if a folder with the projectname would be automatically created (only the first time, after that this folder is used for this project) within a predefined folder and all the .drps saved in that folder (with the project name) would be saved with an automatic timestamp as part of the .drp filename (timestamp in the order year, month, day, time + projectname for the drp).
Then all the .drps of one project would be in one folder: perfect.

Please write this.
So many Resolve users would thank you for it. And it saves a lot of hussle for you, too.
:D
Offline
User avatar

iddos-l

  • Posts: 388
  • Joined: Sat Mar 30, 2019 7:55 pm
  • Real Name: iddo lahman

Re: Can I assign a script to a key?

PostMon Aug 03, 2020 5:19 am

You’re request is outside of the Resolve realm.
Writing this is more complicated then it sounds. Making it cross platform and especially watch folder on a windows platform is a bit of a hustle.
Not a 10 min project. I’m sure Igur can do it, but it’s time consuming. Not to mention support and help for every user’s use case.

Check out “Syncovery”
It a great program that does lots of things including the ability to folder monitoring which is what your after. You will need the professional edition for that.


Sent from my iPhone using Tapatalk
Offline
User avatar

Igor Riđanović

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

Re: Can I assign a script to a key?

PostMon Aug 03, 2020 7:43 am

daktulus wrote:
Igor Riđanović wrote:If you write a script that adds a timestamp automatically, everytime a .drp is saved (instead of overwrting the old .drp) this would be the solution.
Please write this.
So many Resolve users would thank you for it. And it saves a lot of hussle for you, too.
:D


The DRP watch folder script is here https://www.hdhead.com/?p=950. I tested in Linux, it should work fine in macOS and Windows too, but I haven't tried it. Python 2.7 and above. In Windows you have to install Python yourself.

The script will wait for the DRPs to appear in a watched directory and move them to a backup directory when the saving stops. At that time it also adds a timestamp.

Come think of it, I didn't limit it to DRP files. It will backup any files you save in the directory.
www.metafide.com - DaVinci Resolve™ Apps

Return to DaVinci Resolve

Who is online

Users browsing this forum: Google Feedfetcher, Howard Roll, Walter Sonius and 87 guests