I am working with an automated python blender script and I would like to know how to complete it with Exit Code 1 when an exception occurs.
The problem is that the exit code from the blender is always 0, even if the python script fails.
The following script definitely creates a non-zero exit code, but the blender sets the exit code to 0
def main():
raise Exception("Fail")
sys.exit(1)
I also tried the command line argument -python-exit-code, but had no effect:
C:\blender.exe --python-exit-code 2 --disable-abort-handler -P bake.py
this gives a slightly better result, because I get the following message:
Error: script failed, file: 'bake.py', exiting with code 2.
Unfortunately, the exit code is still 0.
Can someone enlighten me with some explanations or decisions on how I can exit the process with the correct exit code?
Thanks so much for any tips!