diff options
Diffstat (limited to 'source/blender/python/intern/bpy.c')
-rw-r--r-- | source/blender/python/intern/bpy.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 525d3fcba78..fb4c285a458 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -60,18 +60,16 @@ #include "../generic/blf_py_api.h" #include "../generic/IDProp.h" -#include "AUD_PyInit.h" - PyObject *bpy_package_py= NULL; -static char bpy_script_paths_doc[] = +PyDoc_STRVAR(bpy_script_paths_doc, ".. function:: script_paths()\n" "\n" " Return 2 paths to blender scripts directories.\n" "\n" " :return: (system, user) strings will be empty when not found.\n" " :rtype: tuple of strings\n" -; +); static PyObject *bpy_script_paths(PyObject *UNUSED(self)) { PyObject *ret= PyTuple_New(2); @@ -85,7 +83,7 @@ static PyObject *bpy_script_paths(PyObject *UNUSED(self)) return ret; } -static char bpy_blend_paths_doc[] = +PyDoc_STRVAR(bpy_blend_paths_doc, ".. function:: blend_paths(absolute=False)\n" "\n" " Returns a list of paths to external files referenced by the loaded .blend file.\n" @@ -94,7 +92,7 @@ static char bpy_blend_paths_doc[] = " :type absolute: boolean\n" " :return: path list.\n" " :rtype: list of strings\n" -; +); static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObject *kw) { struct BPathIterator *bpi; @@ -137,7 +135,7 @@ static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObjec } -// static char bpy_user_resource_doc[]= // now in bpy/utils.py +// PyDoc_STRVAR(bpy_user_resource_doc[]= // now in bpy/utils.py static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObject *kw) { char *type; @@ -169,7 +167,7 @@ static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObj return PyUnicode_DecodeFSDefault(path ? path : ""); } -static char bpy_resource_path_doc[] = +PyDoc_STRVAR(bpy_resource_path_doc, ".. function:: resource_path(type, major=2, minor=57)\n" "\n" " Return the base path for storing system files.\n" @@ -182,7 +180,7 @@ static char bpy_resource_path_doc[] = " :type minor: string\n" " :return: the resource path (not necessarily existing).\n" " :rtype: string\n" -; +); static PyObject *bpy_resource_path(PyObject *UNUSED(self), PyObject *args, PyObject *kw) { char *type; @@ -231,7 +229,7 @@ static PyObject *bpy_import_test(const char *modname) /***************************************************************************** * Description: Creates the bpy module and adds it to sys.modules for importing *****************************************************************************/ -void BPy_init_modules( void ) +void BPy_init_modules(void) { extern BPy_StructRNA *bpy_context_module; extern int bpy_lib_init(PyObject *); @@ -239,7 +237,7 @@ void BPy_init_modules( void ) PyObject *mod; /* Needs to be first since this dir is needed for future modules */ - char *modpath= BLI_get_folder(BLENDER_SCRIPTS, "modules"); + char *modpath= BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, "modules"); if(modpath) { // printf("bpy: found module path '%s'.\n", modpath); PyObject *sys_path= PySys_GetObject("path"); /* borrow */ @@ -262,17 +260,17 @@ void BPy_init_modules( void ) /* run first, initializes rna types */ BPY_rna_init(); - PyModule_AddObject( mod, "types", BPY_rna_types() ); /* needs to be first so bpy_types can run */ + PyModule_AddObject(mod, "types", BPY_rna_types()); /* needs to be first so bpy_types can run */ PyModule_AddObject(mod, "StructMetaPropGroup", (PyObject *)&pyrna_struct_meta_idprop_Type); /* metaclass for idprop types, bpy_types.py needs access */ bpy_lib_init(mod); /* adds '_bpy._library_load', must be called before 'bpy_types' which uses it */ 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"); - PyModule_AddObject( mod, "props", BPY_rna_props() ); - PyModule_AddObject( mod, "ops", BPY_operator_module() ); /* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */ - PyModule_AddObject( mod, "app", BPY_app_struct() ); + PyModule_AddObject(mod, "props", BPY_rna_props()); + PyModule_AddObject(mod, "ops", BPY_operator_module()); /* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */ + PyModule_AddObject(mod, "app", BPY_app_struct()); /* bpy context */ RNA_pointer_create(NULL, &RNA_Context, (void *)BPy_GetContext(), &ctx_ptr); |