Index: source/creator/creator.c =================================================================== --- source/creator/creator.c (revision 13018) +++ source/creator/creator.c (working copy) @@ -619,7 +619,15 @@ a++; if (a < argc){ if(G.scene) { - BLI_strncpy(G.scene->r.pic, argv[a], FILE_MAXDIR); + char filename[FILE_MAXDIR + FILE_MAXFILE]; + char dirname[FILE_MAXDIR + FILE_MAXFILE]; + filename[0] = '\0'; + BLI_make_file_string("/", filename, BLI_getwdN(dirname), argv[a]); + + if (filename[0]=='\0') + BLI_strncpy(filename, argv[a], sizeof(filename)); + + BLI_strncpy(G.scene->r.pic, filename, FILE_MAXDIR); } else { printf("\nError: no blend loaded. cannot use '-o'.\n"); } @@ -687,9 +695,18 @@ break; } } - else { + else { + /* Make the path absolute */ + char filename[FILE_MAXDIR + FILE_MAXFILE]; + char dirname[FILE_MAXDIR + FILE_MAXFILE]; + filename[0] = '\0'; + BLI_make_file_string("/", filename, BLI_getwdN(dirname), argv[a]); + + if (filename[0]=='\0') + BLI_strncpy(filename, argv[a], sizeof(filename)); + if (G.background) { - BKE_read_file(argv[a], NULL); + BKE_read_file(filename, NULL); sound_initialize_sounds(); /* happens for the UI on file reading too */ @@ -698,7 +715,7 @@ } else { /* we are not running in background mode here, but start blender in UI mode with a file - this should do everything a 'load file' does */ - BIF_read_file(argv[a]); + BIF_read_file(filename); } } }