Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/intern/bpy.c
| Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
| #include "bpy_utils_previews.h" | #include "bpy_utils_previews.h" | ||||
| #include "bpy_utils_units.h" | #include "bpy_utils_units.h" | ||||
| #include "../generic/py_capi_utils.h" | #include "../generic/py_capi_utils.h" | ||||
| #include "../generic/python_utildefines.h" | #include "../generic/python_utildefines.h" | ||||
| /* external util modules */ | /* external util modules */ | ||||
| #include "../generic/idprop_py_api.h" | #include "../generic/idprop_py_api.h" | ||||
| #include "bpy_msgbus.h" | |||||
| #ifdef WITH_FREESTYLE | #ifdef WITH_FREESTYLE | ||||
| # include "BPy_Freestyle.h" | # include "BPy_Freestyle.h" | ||||
| #endif | #endif | ||||
| PyObject *bpy_package_py = NULL; | PyObject *bpy_package_py = NULL; | ||||
| PyDoc_STRVAR(bpy_script_paths_doc, | PyDoc_STRVAR(bpy_script_paths_doc, | ||||
| ▲ Show 20 Lines • Show All 276 Lines • ▼ Show 20 Lines | #endif | ||||
| 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()); | PyModule_AddObject(mod, "_utils_units", BPY_utils_units()); | ||||
| PyModule_AddObject(mod, "_utils_previews", BPY_utils_previews_module()); | PyModule_AddObject(mod, "_utils_previews", BPY_utils_previews_module()); | ||||
| PyModule_AddObject(mod, "msgbus", BPY_msgbus_module()); | |||||
| /* 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 | |||||