[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35638] trunk/blender/source/blender/ python/intern/bpy_operator.c: fix for crash when running WM_OT_read_factory_settings() from a script and then importing.
Campbell Barton
ideasman42 at gmail.com
Sun Mar 20 08:23:17 CET 2011
Revision: 35638
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35638
Author: campbellbarton
Date: 2011-03-20 07:23:17 +0000 (Sun, 20 Mar 2011)
Log Message:
-----------
fix for crash when running WM_OT_read_factory_settings() from a script and then importing.
Modified Paths:
--------------
trunk/blender/source/blender/python/intern/bpy_operator.c
Modified: trunk/blender/source/blender/python/intern/bpy_operator.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_operator.c 2011-03-20 06:02:47 UTC (rev 35637)
+++ trunk/blender/source/blender/python/intern/bpy_operator.c 2011-03-20 07:23:17 UTC (rev 35638)
@@ -40,6 +40,7 @@
#include "bpy_operator_wrap.h"
#include "bpy_rna.h" /* for setting arg props only - pyrna_py_to_prop() */
#include "bpy_util.h"
+#include "../generic/bpy_internal_import.h"
#include "BLI_utildefines.h"
@@ -246,6 +247,8 @@
* function corrects bpy.data (internal Main pointer) */
BPY_modules_update(C);
+ /* needed for when WM_OT_read_factory_settings us called fro within a script */
+ bpy_import_main_set(CTX_data_main(C));
/* return operator_ret as a bpy enum */
return pyrna_enum_bitfield_to_py(operator_return_items, operator_ret);
More information about the Bf-blender-cvs
mailing list