[Bf-blender-cvs] [a6fd26c8] gooseberry_farm: 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:09:05 CEST 2015


Commit: a6fd26c88439b4c39bcac92f739bc0efbcbb3b4a
Author: Sergey Sharybin
Date:   Thu Jun 18 14:07:39 2015 +0200
Branches: gooseberry_farm
https://developer.blender.org/rBa6fd26c88439b4c39bcac92f739bc0efbcbb3b4a

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 29fad13..f366c59 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -1377,6 +1377,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