"Save Project" event or GetProjectLastModifiedTime

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

jonofus

  • Posts: 1
  • Joined: Wed Aug 30, 2023 5:29 pm
  • Real Name: Jonathan Hearn

"Save Project" event or GetProjectLastModifiedTime

PostWed Aug 30, 2023 5:37 pm

Hello!

I've been scripting DaVinci Resolve using Python (and a bit of Lua [_and_ I think Fusion Script])

Forum / third-party website Google results, official/unoffical documention and the vaguely educated guesses Chat GPT provides has got me quite far.

One thing I'd quite like to do is have some code run when the current project is saved.

Ideally I'd register some callback with a "on save project" event, but in lieu of that I could regularly poll the modified time of the current project and keep an eye on it.

Using `dir` in a Python shell, I haven't yet discovered a candidate for the aforementioned event, but I have discovered the that the ProjectManager object has a GetProjectLastModifiedTime method.

I've tried passing it a Project object, a project name string, and nothing, but it always returns `None`

Does anyone have any insights into either of these investigations?
Offline
User avatar

Roy Nieterau

  • Posts: 50
  • Joined: Wed May 20, 2015 2:02 pm
  • Location: Utrecht, The Netherlands

Re: "Save Project" event or GetProjectLastModifiedTime

PostSun Oct 08, 2023 9:03 pm

Just want to +1 to see examples of how one could add callbacks to Resolve project open and save.

Using the fusion.UIManager we could maybe AddNotify to certain actions - but I haven't found any way through that to listen to resolve actions like saving/opening projects similar to the Fusion actions:

- Comp_Save
- Comp_SaveAs
- Comp_New
- Comp_Opened

I'm basically looking for the Resolve Project equivalents to these.
Offline
User avatar

MartyjWebb

  • Posts: 96
  • Joined: Fri Jul 27, 2018 4:50 pm
  • Location: London, UK
  • Real Name: Martin Webb

Re: "Save Project" event or GetProjectLastModifiedTime

PostMon Nov 13, 2023 4:54 pm

+1 to having GetProjectLastModifiedTime work as expected. There's a lot I would like to script with that!
Head of Picture / Senior Colourist

Resolve 18.6. Mac OS Monterey 12.3
2019 MAc Pro: 3.3 GHz 12-Core Intel Xeon W, W6800X Duo
Offline
User avatar

MartyjWebb

  • Posts: 96
  • Joined: Fri Jul 27, 2018 4:50 pm
  • Location: London, UK
  • Real Name: Martin Webb

Re: "Save Project" event or GetProjectLastModifiedTime

PostMon Nov 13, 2023 7:48 pm

Roy Nieterau wrote:but I haven't found any way through that to listen to resolve actions like saving/opening projects


I've been reading the resolve log file to "listen" to Resolve. It mostly works quite well. I use it a lot to watch for when resolve is launched and is shut down, goes into sleep mode and when projects are opened and closed.
Head of Picture / Senior Colourist

Resolve 18.6. Mac OS Monterey 12.3
2019 MAc Pro: 3.3 GHz 12-Core Intel Xeon W, W6800X Duo

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 23 guests