Python - Save Project as (missing)

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

Benjamin Kratzin

  • Posts: 63
  • Joined: Mon Apr 24, 2017 8:44 pm

Python - Save Project as (missing)

PostMon Mar 30, 2020 8:02 pm

Hi all,

I'm missing the opportunity to save my current open resolve project as a new project with a new name in python.

CreateProject() Saves it as a completely clean project but with my given name.
Saveproject() Only saves the project under the current name.
SetName() Only sets a new name.

Am I missing something, I just want to save my current project with a new name without overwriting it?
Similar to the "Save Project as" function from the menu.

Thanks in advance,
Ben
Director / DP / VFX Supervisor | www.benjaminkratzin.com | vimeo.com/benjaminkratzin
Offline
User avatar

roger.magnusson

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

Re: Python - Save Project as (missing)

PostMon Mar 30, 2020 8:29 pm

Doesn't SetName("new name"), then SaveProject() do exactly that? Or do you mean SaveProject() uses the old name?

If you mean you want to save it to another folder within the Project Manager then that doesn't look like it's possible. Then again, you can't do that in the "Save Project As" dialog either.
Offline

Benjamin Kratzin

  • Posts: 63
  • Joined: Mon Apr 24, 2017 8:44 pm

Re: Python - Save Project as (missing)

PostMon Mar 30, 2020 10:54 pm

No, I don't need to place it into another folder, since I know how I would approach this. My current issue is, that it simply overwrites the current open project instead of copying the project and then saving it under a new name as a new project file. So I have no chance to version up. Hope that makes sense. Thanks for your thoughts on that.
Director / DP / VFX Supervisor | www.benjaminkratzin.com | vimeo.com/benjaminkratzin
Offline
User avatar

roger.magnusson

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

Re: Python - Save Project as (missing)

PostTue Mar 31, 2020 1:44 am

Using my admittedly messed up Resolve projects on my dev machine I can't get SetName() to do what I expect it to and it always returns false.
Offline
User avatar

Igor Riđanović

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

Re: Python - Save Project as (missing)

PostTue Mar 31, 2020 7:01 am

roger.magnusson wrote:it always returns false.


Same for me on MacOS, Resolve Studio 15.3.1, Python 2.8 (or so). I encoded the string as ASCII and as UTF-8. Both returned False.
www.metafide.com - DaVinci Resolve™ Apps
Offline

Peter Chamberlain

Blackmagic Design

  • Posts: 14921
  • Joined: Wed Aug 22, 2012 7:08 am

Re: Python - Save Project as (missing)

PostTue Mar 31, 2020 9:11 am

I think you can except any dev support for 15.3 which is quite superseded, particularly with the scripting work up to 16.2.
DaVinci Resolve Product Manager
Offline
User avatar

roger.magnusson

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

Re: Python - Save Project as (missing)

PostTue Mar 31, 2020 9:32 am

I'm on Resolve Studio v16.2.0.055, using Lua, Windows 10 v1909 and seeing this issue with Project.SetName().
Offline

Benjamin Kratzin

  • Posts: 63
  • Joined: Mon Apr 24, 2017 8:44 pm

Re: Python - Save Project as (missing)

PostTue Mar 31, 2020 9:40 am

On my machine "Resolve 16.2" SetName() works and renames the project.

# This is False as it is the same proj name
proj_name = project.GetName()
print(project.SetName(proj_name))

# I'm removing the last four chars of the proj name so it's no longer the same. Result is True
print(project.SetName(proj_name[:-4]))


But as said, this alone is not what I'm looking for.
Director / DP / VFX Supervisor | www.benjaminkratzin.com | vimeo.com/benjaminkratzin
Offline
User avatar

Igor Riđanović

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

Re: Python - Save Project as (missing)

PostTue Mar 31, 2020 8:46 pm

I think Roger and I went off on another tangent here. The SetName() works in 16.2.0 for me while it failed for both of us in 15.3.1.

But that's not what Benjamin was asking. SetName() changes the project name in the database. He would like to fork a copy of the project equivalent to "Save As."

I haven't tested it but it may be possible to achieve this by exporting a DRP using ExportProject() method, creating a new project with a unique name, and importing this DRP into the project.
www.metafide.com - DaVinci Resolve™ Apps
Offline

Benjamin Kratzin

  • Posts: 63
  • Joined: Mon Apr 24, 2017 8:44 pm

Re: Python - Save Project as (missing)

PostTue Mar 31, 2020 11:11 pm

Hi Igor,
No worries, I hope you solve that question as well.

We've been thinking the same :) since I was already trying the drp export route. But I thought this probably would take longer (closing and reopening the session and could have effects to the gallery) and feels like a "hack". I think I will go with that route if we can't find another solution for it. I thought I probably missed something in the API as it's a very basic function.
Director / DP / VFX Supervisor | www.benjaminkratzin.com | vimeo.com/benjaminkratzin
Offline

julian_b

  • Posts: 236
  • Joined: Sun Jan 22, 2017 1:45 pm
  • Real Name: Julian Böhme

Re: Python - Save Project as (missing)

PostThu May 14, 2020 11:04 pm

For me, SetName() is not working.

Code: Select all
proj = project_manager.GetCurrentProject()
proj.setName("New Name")


It always returns False.
Any help?
Offline

morkaman

  • Posts: 7
  • Joined: Wed Oct 07, 2020 12:58 pm
  • Real Name: Andrej Mores

Re: Python - Save Project as (missing)

PostTue Apr 13, 2021 6:06 pm

julian_b wrote:For me, SetName() is not working.

Code: Select all
proj = project_manager.GetCurrentProject()
proj.setName("New Name")


It always returns False.
Any help?

UPDATE: Doesn´t work in 17.1 - Python 3.6 neither :(

Return to DaVinci Resolve

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Mads Johansen, MagicMind, Tijoda1 and 282 guests