[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24451] branches/blender2.4/source/blender /python/api2_2x/Blender.c: 2.4x fix for Blender.Load()

Campbell Barton ideasman42 at gmail.com
Tue Nov 10 16:34:27 CET 2009


Revision: 24451
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24451
Author:   campbellbarton
Date:     2009-11-10 16:34:27 +0100 (Tue, 10 Nov 2009)

Log Message:
-----------
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

Modified Paths:
--------------
    branches/blender2.4/source/blender/python/api2_2x/Blender.c

Modified: branches/blender2.4/source/blender/python/api2_2x/Blender.c
===================================================================
--- branches/blender2.4/source/blender/python/api2_2x/Blender.c	2009-11-10 15:09:53 UTC (rev 24450)
+++ branches/blender2.4/source/blender/python/api2_2x/Blender.c	2009-11-10 15:34:27 UTC (rev 24451)
@@ -626,13 +626,6 @@
 			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,7 +645,15 @@
 	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.
 		 * Also do not allow a nested scriptlink (called from inside another)





More information about the Bf-blender-cvs mailing list