From 3d3f6b1ddc655a070c20e41abec2e7850fd266e6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 11 Sep 2011 13:46:58 +0000 Subject: fix for 'blender -E' crashing. --- source/creator/creator.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'source/creator') diff --git a/source/creator/creator.c b/source/creator/creator.c index 9b2cfb08382..264b4fc6208 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -542,22 +542,17 @@ static int set_output(int argc, const char **argv, void *data) static int set_engine(int argc, const char **argv, void *data) { bContext *C = data; - if (argc >= 1) - { - if (!strcmp(argv[1],"help")) - { + if (argc >= 2) { + if (!strcmp(argv[1], "help")) { RenderEngineType *type = NULL; - - for( type = R_engines.first; type; type = type->next ) - { + printf("Blender Engine Listing:\n"); + for( type = R_engines.first; type; type = type->next ) { printf("\t%s\n", type->idname); } exit(0); } - else - { - if (CTX_data_scene(C)==NULL) - { + else { + if (CTX_data_scene(C)==NULL) { printf("\nError: no blend loaded. order the arguments so '-E / --engine ' is after a blend is loaded.\n"); } else { @@ -574,7 +569,7 @@ static int set_engine(int argc, const char **argv, void *data) } else { - printf("\nEngine not specified.\n"); + printf("\nEngine not specified, give 'help' for a list of available engines.\n"); return 0; } } -- cgit v1.2.3