Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-03-03 11:56:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-03-03 11:56:48 +0300
commit560de5e6e507745ba928d2bdc514882e78ea4576 (patch)
tree0538b28e45303809ad46dec81a687ea08ad26231 /source/blender/python
parent9aa451f631448be0d5c08ddad9983e1bc7a655d5 (diff)
set the context on importing bpy module.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c
index dfbad7aa610..4df14a1f603 100644
--- a/source/blender/python/intern/bpy.c
+++ b/source/blender/python/intern/bpy.c
@@ -91,7 +91,7 @@ static void bpy_import_test(char *modname)
*****************************************************************************/
void BPy_init_modules( void )
{
- extern BPy_StructRNA *bpy_context_module;
+ extern BPy_StructRNA *bpy_context_module;
PyObject *mod;
/* Needs to be first since this dir is needed for future modules */
@@ -129,11 +129,11 @@ void BPy_init_modules( void )
PyModule_AddObject( mod, "app", BPY_app_struct() );
/* bpy context */
- bpy_context_module= ( BPy_StructRNA * ) PyObject_NEW( BPy_StructRNA, &pyrna_struct_Type );
- RNA_pointer_create(NULL, &RNA_Context, NULL, &bpy_context_module->ptr);
- bpy_context_module->freeptr= 0;
- PyModule_AddObject(mod, "context", (PyObject *)bpy_context_module);
-
+ bpy_context_module= ( BPy_StructRNA * ) PyObject_NEW( BPy_StructRNA, &pyrna_struct_Type );
+ RNA_pointer_create(NULL, &RNA_Context, BPy_GetContext(), &bpy_context_module->ptr);
+ bpy_context_module->freeptr= 0;
+ PyModule_AddObject(mod, "context", (PyObject *)bpy_context_module);
+
/* utility func's that have nowhere else to go */
PyModule_AddObject(mod, meth_bpy_home_paths->ml_name, (PyObject *)PyCFunction_New(meth_bpy_home_paths, NULL));