[Bf-blender-cvs] [7e529c2] master: Return non-zero exit code when running blender from the command line and reading file has failed

Sergey Sharybin noreply at git.blender.org
Thu Jun 18 14:08:33 CEST 2015


Commit: 7e529c2a64752c0483f84024fb71edc11d88578e
Author: Sergey Sharybin
Date:   Thu Jun 18 14:07:39 2015 +0200
Branches: master
https://developer.blender.org/rB7e529c2a64752c0483f84024fb71edc11d88578e

Return non-zero exit code when running blender from the command line and reading file has failed

This way automated scripts can actually see if some issue happened.

===================================================================

M	source/creator/creator.c

===================================================================

diff --git a/source/creator/creator.c b/source/creator/creator.c
index 8c1ae3d..856d0e1 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -1405,6 +1405,14 @@ static int load_file(int UNUSED(argc), const char **argv, void *data)
 		}
 		else {
 			/* failed to load file, stop processing arguments */
+			if (G.background) {
+				/* Set is_break if running in the background mode so
+				 * blender will return non-zero exit code which then
+				 * could be used in automated script to control how
+				 * good or bad things are.
+				 */
+				G.is_break = true;
+			}
 			return -1;
 		}




More information about the Bf-blender-cvs mailing list