diff options
Diffstat (limited to 'source/blender/python/intern/bpy.c')
-rw-r--r-- | source/blender/python/intern/bpy.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 134e718bce5..dbeccfdb8e6 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -31,10 +31,9 @@ #include <Python.h> #include "BLI_utildefines.h" -#include "BLI_path_util.h" #include "BLI_string.h" -#include "BKE_main.h" +#include "BKE_appdir.h" #include "BKE_global.h" /* XXX, G.main only */ #include "BKE_blender.h" #include "BKE_bpath.h" @@ -53,14 +52,8 @@ #include "../generic/py_capi_utils.h" -#include "MEM_guardedalloc.h" - /* external util modules */ #include "../generic/idprop_py_api.h" -#include "../generic/bgl.h" -#include "../generic/blf_py_api.h" -#include "../generic/blf_py_api.h" -#include "../mathutils/mathutils.h" #ifdef WITH_FREESTYLE # include "BPy_Freestyle.h" @@ -82,11 +75,11 @@ static PyObject *bpy_script_paths(PyObject *UNUSED(self)) PyObject *item; const char *path; - path = BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, NULL); + path = BKE_appdir_folder_id(BLENDER_SYSTEM_SCRIPTS, NULL); item = PyC_UnicodeFromByte(path ? path : ""); BLI_assert(item != NULL); PyTuple_SET_ITEM(ret, 0, item); - path = BLI_get_folder(BLENDER_USER_SCRIPTS, NULL); + path = BKE_appdir_folder_id(BLENDER_USER_SCRIPTS, NULL); item = PyC_UnicodeFromByte(path ? path : ""); BLI_assert(item != NULL); PyTuple_SET_ITEM(ret, 1, item); @@ -168,11 +161,11 @@ static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObj return NULL; } - /* same logic as BLI_get_folder_create(), but best leave it up to the script author to create */ - path = BLI_get_folder(folder_id, subdir); + /* same logic as BKE_appdir_folder_id_create(), but best leave it up to the script author to create */ + path = BKE_appdir_folder_id(folder_id, subdir); if (!path) - path = BLI_get_user_folder_notest(folder_id, subdir); + path = BKE_appdir_folder_id_user_notest(folder_id, subdir); return PyC_UnicodeFromByte(path ? path : ""); } @@ -211,7 +204,7 @@ static PyObject *bpy_resource_path(PyObject *UNUSED(self), PyObject *args, PyObj return NULL; } - path = BLI_get_folder_version(folder_id, (major * 100) + minor, false); + path = BKE_appdir_folder_id_version(folder_id, (major * 100) + minor, false); return PyC_UnicodeFromByte(path ? path : ""); } @@ -296,7 +289,7 @@ void BPy_init_modules(void) PyObject *mod; /* Needs to be first since this dir is needed for future modules */ - const char * const modpath = BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, "modules"); + const char * const modpath = BKE_appdir_folder_id(BLENDER_SYSTEM_SCRIPTS, "modules"); if (modpath) { // printf("bpy: found module path '%s'.\n", modpath); PyObject *sys_path = PySys_GetObject("path"); /* borrow */ |