Fix for a bug where python could save a sceneless blend file.

https://projects.blender.org/tracker/index.php?func=detail&aid=3902&group_id=9&atid=125
This commit is contained in:
2006-03-21 22:30:29 +00:00
parent 9cf9ce75af
commit 742ba52072

View File

@@ -626,6 +626,13 @@ static PyObject *Blender_Save( PyObject * self, PyObject * args )
disable_where_script( 1 ); /* to avoid error popups in the write_* functions */
if( BLI_testextensie( fname, ".blend" ) ) {
/* fix for people who save a new blend in background mode. */
if (!G.scene) {
Scene *scene;
scene= add_scene("Scene");
}
if( G.fileflags & G_AUTOPACK )
packAll( );
if( !BLO_write_file( fname, G.fileflags, &error ) ) {