Error in loading a project in background mode - Windows


#1

Hello!

I’m trying to achieve this:
Launching Natron from commandline with -b option, load a .ntp file, do some modification, and save it to a new file.

When in my script.py I call:

app.loadProject(filename)

…Natron always crashes with an error:
ERROR: Natron: Project file name empty

No matter what the .ntp file contains. It happens even with a completely empty file.
From GUI script editor it works fine.

I’m running version 2.0.0 RC3 on Windows 8 64bit.

Thanks a lot in advance for all advice! :slight_smile:


#2

It was fixed recently and will be released in RC4 soon;)


#3

Excellent! Thank you so much! :blush:

I think I can put together rest of the script I need in GUI mode already.
Do you have an estimate when the RC4 would be available? Or should I test some of the latest snapshot builds?


#4

You can use a recent snapshot


#5

I picked the latest Win build, but it seems to have the same problem when loading projects without gui than the stable RC3 (both -t and -b commandline modes). Interactive -t mode doesn’t crash when loading projects, but just won’t load anything. For example app.loadProject and app.saveProjectAs ends up saving completely empty file.

The snapshot I have now is generated from commit 557b49176d0f54d133e5bfb747732203d5fc3aaf.


#6

Has anyone else had this problem?

It still keeps me from loading projects in commandline, even after downloading the RC4.


#7

Can you send me a sample project to reproduce the bug ?


#8

Here is a simple file with only 2 nodes in it (Stmap and iDistort):
https://dl.dropboxusercontent.com/u/4932378/natron/natron_rc5_project.ntp

When I launch “natron.exe -t”, and write:

app.loadProject("d:/natron_rc5_project.ntp")
app.saveProjectAs("d:/natron_rc5_project_saved.ntp")

…the new file is totally empty.

And if I try to do this with “natron.exe -b” and a pythonfile, the execution crashes with error:

ERROR: Natron: Project file name empty

But, when I load project in GUI & script editor eveything seems to work as expected.

Is there a change I have misunderstood something? :slight_smile:


#9

I fixed the bug in a recent commit. Note however that saving a project in background mode will not embed in the project any GUI-related information (such as node positions, colors…).
Also note that since loading a python script in background mode, Natron will try to start a render whenever python script is finished executing, and since your ntp file does not have any write node in it, it will just print the error you mention.
Hope that clarifies it