fix for 'blender -E' crashing.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 11 Sep 2011 13:46:58 +0000 (13:46 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 11 Sep 2011 13:46:58 +0000 (13:46 +0000)
source/creator/creator.c

index 9b2cfb0838230c66534d93db0a0a31d94071133c..264b4fc6208c54bdc3a401b51fc6db6e2d875494 100644 (file)
@@ -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;
        }
 }