diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-20 10:23:17 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-20 10:23:17 +0300 |
commit | 790e47768a850d4a7bfc0c9cb2da94d8f0e26336 (patch) | |
tree | f087210edb6a9ea04aba77f27174b5f88b6db2ee /source | |
parent | 35cee79a37ba1a6712ec92e027c70c9c14cd5b94 (diff) |
fix for crash when running WM_OT_read_factory_settings() from a script and then importing.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/intern/bpy_operator.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index f2ac9b282e1..a116aa0e9c0 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -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 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) * 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); |