Move Playhead via script

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

professorWM

  • Posts: 11
  • Joined: Thu May 10, 2018 1:16 pm
  • Real Name: Waldemar Mitulla

Move Playhead via script

PostSun Dec 08, 2019 11:07 pm

Hello,

I have started to script resolve in python. Well there is not too much information available.
So I found out many thinks but some simple questions are still here:

Can some please tell how to move (and readout) the playhead position via python 3 script?

So when you know this you probably know also how to zoom in/out via python?

And possibly you also know how I can open the "Cut" page via script.
Well I know it for all other pages e.g. for media:

import DaVinciResolveScript as resolveScriptHandler
resolve=resolveScriptHandler.scriptapp("Resolve")
resolve.OpenPage("media")

resolve.OpenPage("cut") # this will not work :(

Many thanks guys.

Would be nice to get some help. Thanks.
Offline

luke.whitehorn

  • Posts: 22
  • Joined: Thu May 02, 2019 8:52 am
  • Real Name: Luke Whitehorn

Re: Move Playhead via script

PostWed Dec 11, 2019 5:36 pm

You must set your environment variables first
Code: Select all
RESOLVE_SCRIPT_API="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\\"


Then use something like this:

Code: Select all
import DaVinciResolveScript as dvr_script

resolve = dvr_script.scriptapp("Resolve")
resolve.OpenPage('edit')


As for placing the playhead at a certain location, I don't think that is possible. The api is very limited :(
Offline

professorWM

  • Posts: 11
  • Joined: Thu May 10, 2018 1:16 pm
  • Real Name: Waldemar Mitulla

Re: Move Playhead via script

PostWed Dec 11, 2019 6:05 pm

Many thanks for the answer.

Well in principle scripting is working.
So environment is OK. Even selecting a page works e.g. switching to "media" or "deliver" page. Only exception is switching to "cut" page. As this is the latest one maybe an bug in scripting lib.

Well I still hope there is way to move the head although you maybe right that scripting is very limited.

BMD anyone?
Offline

luke.whitehorn

  • Posts: 22
  • Joined: Thu May 02, 2019 8:52 am
  • Real Name: Luke Whitehorn

Re: Move Playhead via script

PostWed Dec 11, 2019 9:22 pm

From the docs it looks like the 'cut' page is not available for some reason :/
Switches to indicated page in DaVinci Resolve. Input can be one of (“media”, “edit”, “fusion”, “color”, “fairlight”, “deliver”).

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 18 guests