MrKepzie / Natron

Open-source compositing software. Node-graph based. Similar in functionalities to Adobe After Effects and Nuke by The Foundry.
www.natron.fr
GNU General Public License v2.0
1.49k stars 163 forks source link

Open, save, rename project within Python API. #887

Closed timurhai closed 9 years ago

timurhai commented 9 years ago

Hi. I am writing a node (group) that can send jobs to Afanasy render farm manager. Node approach has much advantages, you can store different render settings by saving several nodes. You can connect several write nodes with afanasy node to (re-)render all "precomps" at once with a specified dependencies, ( for example "key" and "back" precomps than "final" to compose them together ).

It is a good practice for an any render manager (submission script) to store current scene to a temporary file (usually just placed in the same folder with some suffix) just before job creation. This way an artist can continue to work with an original scene and save changes. And there will be no mess with various versions frames in the same sequence. Artist should sure that the result will represent exactly the version at the moment that job was sent (all frames).

btw All other CG soft that i used with Afanasy has such scripting functions :) At least any soft can just save scene (this way i can just copy file with a new temp name)

ps Nuke has "nuke.scriptSave([scenename])" :)

MrKepzie commented 9 years ago

There are now binded, see http://natron.readthedocs.org/en/workshop/PythonReference/NatronEngine/App.html

timurhai commented 9 years ago

Great! For some time i can't check it. But i want to say: (my opinion) the best api has Houdini (3d CG Soft).

It has a function to save project to the specified file. It does not rename project. It does not change project modication state. This approach is the best for render managers:

And a submission script just asks application to save project to some temp file, later when artist press CTRL+S it saves to the original name.

ps Sorry but i can spend everyday with this stuff, so i can late with reactions.

MrKepzie commented 9 years ago

Ok,

I’ve implemented a saveTempProject(filename) function which does what you say, without updating project properties.

On 8 Sep 2015, at 17:23, Timur Hairulin notifications@github.com wrote:

Great! For some time i can't check it. But i want to say: (my opinion) the best api has Houdini (3d CG Soft).

after the Natron, of course :) It has a function to save project to the specified file. It does not rename project. It does not change project modication state. This approach is the best for render managers: May be an artist does not want to save current version at all, but wants to test it. ( and a submission script just asks application to save project to some temp file, later when artist press CTRL+S it saves to the original name ) ps Sorry but i can spend everyday with this stuff, so i can late with reacions.

— Reply to this email directly or view it on GitHub https://github.com/MrKepzie/Natron/issues/887#issuecomment-138599300.

timurhai commented 9 years ago

Great! Thank you! ps Will return to this theme later, very busy for now ((

mangopipeline commented 8 years ago

since the saveProject function ignores the input in gui mode, there's currently no way to save the file under a different name in python with out reopening the file (which is required if using saveTempProject)...

ideally instead of ignoring the input, if the developer wants to save over, or have the save dialog pop up for untitled projects he should input a value of None...

Should look like this... app.saveProject(r'c:\temp\natron.ntp') #would save to the given location app.saveProject(None) #would save over existing name, or pop up save dialog if never saved before.

I think this ticket should be reopened...

bradwfalk commented 2 years ago

no kidding, this does need to be reopened. Why not use a file export function to export to a new name.