Bugfix #7804 : Opened file is not registered correctly when started from command line
- treat file passed as parameter the same as if loaded from UI if Blender isn't running in background mode. - only set relative base as valid if file loaded successfully.
This commit is contained in:
@@ -458,7 +458,7 @@ void BIF_read_file(char *name)
|
|||||||
|
|
||||||
if(retval==2) init_userdef_file(); // in case a userdef is read from regular .blend
|
if(retval==2) init_userdef_file(); // in case a userdef is read from regular .blend
|
||||||
|
|
||||||
G.relbase_valid = 1;
|
if (retval!=0) G.relbase_valid = 1;
|
||||||
|
|
||||||
undo_editmode_clear();
|
undo_editmode_clear();
|
||||||
BKE_reset_undo();
|
BKE_reset_undo();
|
||||||
|
@@ -686,13 +686,19 @@ int main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BKE_read_file(argv[a], NULL);
|
if (G.background) {
|
||||||
sound_initialize_sounds();
|
BKE_read_file(argv[a], NULL);
|
||||||
|
sound_initialize_sounds();
|
||||||
/* happens for the UI on file reading too */
|
|
||||||
BKE_reset_undo();
|
/* happens for the UI on file reading too */
|
||||||
BKE_write_undo("original"); /* save current state */
|
BKE_reset_undo();
|
||||||
|
BKE_write_undo("original"); /* save current state */
|
||||||
|
} 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]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user