15#include <structmember.h>
18#include "RNA_prototypes.hh"
31#define PYDOC_SOURCE_TYPES_LITERAL "Literal['IMAGE', 'MOVIE', 'BLEND', 'FONT', 'OBJECT_IO']"
35 bpy_utils_previews_new_doc,
36 ".. method:: new(name)\n"
38 " Generate a new empty preview.\n"
40 " :param name: The name (unique id) identifying the preview.\n"
42 " :return: The Preview matching given name, or a new empty one.\n"
43 " :rtype: :class:`bpy.types.ImagePreview`\n"
46 " :raises KeyError: if ``name`` already exists.\n");
52 if (!PyArg_ParseTuple(args,
68 bpy_utils_previews_load_doc,
69 ".. method:: load(name, filepath, file_type, force_reload=False)\n"
71 " Generate a new preview from given file path.\n"
73 " :param name: The name (unique id) identifying the preview.\n"
75 " :param filepath: The file path to generate the preview from.\n"
76 " :type filepath: str | bytes\n"
77 " :param file_type: The type of file, needed to generate the preview.\n"
80 " :param force_reload: If True, force running thumbnail manager even if preview already "
82 " :type force_reload: bool\n"
83 " :return: The Preview matching given name, or a new empty one.\n"
84 " :rtype: :class:`bpy.types.ImagePreview`\n"
87 " :raises KeyError: if ``name`` already exists.\n");
106 int force_reload =
false;
108 if (!PyArg_ParseTuple(args,
136 bpy_utils_previews_release_doc,
137 ".. method:: release(name)\n"
139 " Release (free) a previously created preview.\n"
142 " :param name: The name (unique id) identifying the preview.\n"
143 " :type name: str\n");
148 if (!PyArg_ParseTuple(args,
163# pragma clang diagnostic push
164# pragma clang diagnostic ignored "-Wcast-function-type"
166# pragma GCC diagnostic push
167# pragma GCC diagnostic ignored "-Wcast-function-type"
176 bpy_utils_previews_new_doc},
180 bpy_utils_previews_load_doc},
184 bpy_utils_previews_release_doc},
185 {
nullptr,
nullptr, 0,
nullptr},
190# pragma clang diagnostic pop
192# pragma GCC diagnostic pop
198 bpy_utils_previews_doc,
199 "This object contains basic static methods to handle cached (non-ID) previews in Blender\n"
200 "(low-level API, not exposed to final users).\n");
203 "bpy._utils_previews",
204 bpy_utils_previews_doc,
#define PYDOC_SOURCE_TYPES_LITERAL
static PyObject * bpy_utils_previews_new(PyObject *, PyObject *args)
PreviewImage * BKE_previewimg_cached_thumbnail_read(const char *name, const char *filepath, int source, bool force_update, bool count_users=false)
static PyObject * bpy_utils_previews_release(PyObject *, PyObject *args)
PyDoc_STRVAR(bpy_bm_new_doc, ".. function:: new(*, use_operators=True)\n" "\n" " :param use_operators: Support calling operators in :mod:`bmesh.ops` (uses some " "extra memory per vert/edge/face).\n" " :type use_operators: bool\n" " :return: Return a new, empty BMesh.\n" " :rtype: :class:`bmesh.types.BMesh`\n")
PreviewImage * BKE_previewimg_cached_ensure(const char *name)
PyObject * pyrna_struct_CreatePyObject(PointerRNA *ptr)
PyObject * BPY_utils_previews_module()
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
int PyC_ParseUnicodeAsBytesAndSize(PyObject *o, void *p)
static PyModuleDef bpy_utils_previews_module
void BKE_previewimg_cached_release(const char *name)
int PyC_ParseStringEnum(PyObject *o, void *p)
static PyMethodDef bpy_utils_previews_methods[]
static PyObject * bpy_utils_previews_load(PyObject *, PyObject *args)