fix [#25262] Keyboard shortcut presets can't be made because of wrong folder

New create option when getting a user resource for creating paths.
  bpy.utils.user_resource(type, path, create=False)
This commit is contained in:
2010-12-18 07:22:52 +00:00
parent 96dfaa215c
commit 77c17d332d
4 changed files with 44 additions and 27 deletions

View File

@@ -121,17 +121,7 @@ static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObjec
}
static char bpy_user_resource_doc[] =
".. function:: user_resource(type, subdir)\n"
"\n"
" Returns a list of paths to external files referenced by the loaded .blend file.\n"
"\n"
" :arg type: Resource type in ['DATAFILES', 'CONFIG', 'SCRIPTS', 'AUTOSAVE'].\n"
" :type type: string\n"
" :arg subdir: Optional subdirectory.\n"
" :type subdir: string\n"
" :return: a path.\n"
" :rtype: string\n";
// static char bpy_user_resource_doc[] = // now in bpy/utils.py
static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObject *kw)
{
char *type;
@@ -165,7 +155,7 @@ static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObj
static PyMethodDef meth_bpy_script_paths = {"script_paths", (PyCFunction)bpy_script_paths, METH_NOARGS, bpy_script_paths_doc};
static PyMethodDef meth_bpy_blend_paths = {"blend_paths", (PyCFunction)bpy_blend_paths, METH_VARARGS|METH_KEYWORDS, bpy_blend_paths_doc};
static PyMethodDef meth_bpy_user_resource = {"user_resource", (PyCFunction)bpy_user_resource, METH_VARARGS|METH_KEYWORDS, bpy_user_resource_doc};
static PyMethodDef meth_bpy_user_resource = {"user_resource", (PyCFunction)bpy_user_resource, METH_VARARGS|METH_KEYWORDS, NULL};
static void bpy_import_test(const char *modname)
{