2.4x fix for Blender.Load()

only bother checking script spaces when loading a blend file

Should be able to load a STL or DXF when script spaces are open now
This commit is contained in:
2009-11-10 15:34:27 +00:00
parent 624d26e0a8
commit bc3eff97c4

View File

@@ -626,13 +626,6 @@ static PyObject *Blender_Load( PyObject * self, PyObject * args )
BLI_strncpy( name, G.sce, FILE_MAXDIR );
}
/* We won't let a new .blend file be loaded if there are still other
* scripts running, since loading a new file will close and remove them. */
if( G.main->script.first != G.main->script.last )
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
"there are other scripts running at the Scripts win, close them first!" );
if( fname ) {
file = open( fname, O_BINARY | O_RDONLY );
@@ -652,6 +645,14 @@ static PyObject *Blender_Load( PyObject * self, PyObject * args )
if( is_blend_file ) {
int during_slink = during_scriptlink( );
/* We won't let a new .blend file be loaded if there are still other
* scripts running, since loading a new file will close and remove them. */
if( G.main->script.first != G.main->script.last )
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
"there are other scripts running at the Scripts win, close them first!" );
/* when loading a .blend file from a scriptlink, the scriptlink pointer
* in BPY_do_pyscript becomes invalid during a loop. Inform it here.