Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/intern/bpy.c
| Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
| #include "bpy.h" | #include "bpy.h" | ||||
| #include "bpy_util.h" | #include "bpy_util.h" | ||||
| #include "bpy_rna.h" | #include "bpy_rna.h" | ||||
| #include "bpy_app.h" | #include "bpy_app.h" | ||||
| #include "bpy_props.h" | #include "bpy_props.h" | ||||
| #include "bpy_library.h" | #include "bpy_library.h" | ||||
| #include "bpy_operator.h" | #include "bpy_operator.h" | ||||
| #include "bpy_utils_units.h" | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| /* external util modules */ | /* external util modules */ | ||||
| #include "../generic/idprop_py_api.h" | #include "../generic/idprop_py_api.h" | ||||
| #include "../generic/bgl.h" | #include "../generic/bgl.h" | ||||
| #include "../generic/blf_py_api.h" | #include "../generic/blf_py_api.h" | ||||
| #include "../mathutils/mathutils.h" | #include "../mathutils/mathutils.h" | ||||
| ▲ Show 20 Lines • Show All 269 Lines • ▼ Show 20 Lines | #endif | ||||
| bpy_import_test("bpy_types"); | bpy_import_test("bpy_types"); | ||||
| PyModule_AddObject(mod, "data", BPY_rna_module()); /* imports bpy_types by running this */ | PyModule_AddObject(mod, "data", BPY_rna_module()); /* imports bpy_types by running this */ | ||||
| bpy_import_test("bpy_types"); | bpy_import_test("bpy_types"); | ||||
| PyModule_AddObject(mod, "props", BPY_rna_props()); | PyModule_AddObject(mod, "props", BPY_rna_props()); | ||||
| /* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */ | /* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */ | ||||
| PyModule_AddObject(mod, "ops", BPY_operator_module()); | PyModule_AddObject(mod, "ops", BPY_operator_module()); | ||||
| PyModule_AddObject(mod, "app", BPY_app_struct()); | PyModule_AddObject(mod, "app", BPY_app_struct()); | ||||
| PyModule_AddObject(mod, "_utils_units", BPY_utils_units()); | |||||
| /* bpy context */ | /* bpy context */ | ||||
| RNA_pointer_create(NULL, &RNA_Context, (void *)BPy_GetContext(), &ctx_ptr); | RNA_pointer_create(NULL, &RNA_Context, (void *)BPy_GetContext(), &ctx_ptr); | ||||
| bpy_context_module = (BPy_StructRNA *)pyrna_struct_CreatePyObject(&ctx_ptr); | bpy_context_module = (BPy_StructRNA *)pyrna_struct_CreatePyObject(&ctx_ptr); | ||||
| /* odd that this is needed, 1 ref on creation and another for the module | /* odd that this is needed, 1 ref on creation and another for the module | ||||
| * but without we get a crash on exit */ | * but without we get a crash on exit */ | ||||
| Py_INCREF(bpy_context_module); | Py_INCREF(bpy_context_module); | ||||
| Show All 19 Lines | |||||