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:
@@ -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 ) ) {
|
||||
|
||||
Reference in New Issue
Block a user