|
Blender V4.3
|
#include <Python.h>#include <structmember.h>#include "BLI_utildefines.h"#include "RNA_access.hh"#include "RNA_prototypes.hh"#include "bpy_rna.hh"#include "bpy_utils_previews.hh"#include "../generic/py_capi_utils.hh"#include "MEM_guardedalloc.h"#include "IMB_thumbs.hh"#include "BKE_preview_image.hh"Go to the source code of this file.
Macros | |
| #define | STR_SOURCE_TYPES "'IMAGE', 'MOVIE', 'BLEND', 'FONT'" |
Functions | |
| PyDoc_STRVAR (bpy_utils_previews_new_doc, ".. method:: new(name)\n" "\n" " Generate a new empty preview.\n" "\n" " :arg name: The name (unique id) identifying the preview.\n" " :type name: str\n" " :return: The Preview matching given name, or a new empty one.\n" " :rtype: :class:`bpy.types.ImagePreview`\n" " :raises KeyError: if ``name`` already exists.") | |
| static PyObject * | bpy_utils_previews_new (PyObject *, PyObject *args) |
| PyDoc_STRVAR (bpy_utils_previews_load_doc, ".. method:: load(name, filepath, filetype, force_reload=False)\n" "\n" " Generate a new preview from given file path.\n" "\n" " :arg name: The name (unique id) identifying the preview.\n" " :type name: str\n" " :arg filepath: The file path to generate the preview from.\n" " :type filepath: str | bytes\n" " :arg filetype: The type of file, needed to generate the preview in [" STR_SOURCE_TYPES "].\n" " :type filetype: str\n" " :arg force_reload: If True, force running thumbnail manager even if preview already " "exists in cache.\n" " :type force_reload: bool\n" " :return: The Preview matching given name, or a new empty one.\n" " :rtype: :class:`bpy.types.ImagePreview`\n" " :raises KeyError: if ``name`` already exists.") | |
| static PyObject * | bpy_utils_previews_load (PyObject *, PyObject *args) |
| PyDoc_STRVAR (bpy_utils_previews_release_doc, ".. method:: release(name)\n" "\n" " Release (free) a previously created preview.\n" "\n" "\n" " :arg name: The name (unique id) identifying the preview.\n" " :type name: str\n") | |
| static PyObject * | bpy_utils_previews_release (PyObject *, PyObject *args) |
| PyDoc_STRVAR (bpy_utils_previews_doc, "This object contains basic static methods to handle cached (non-ID) previews in Blender\n" "(low-level API, not exposed to final users).") | |
| PyObject * | BPY_utils_previews_module () |
Variables | |
| static PyMethodDef | bpy_utils_previews_methods [] |
| static PyModuleDef | bpy_utils_previews_module |
This file defines a singleton py object accessed via 'bpy.utils.previews', which exposes low-level API for custom previews/icons. It is replaced in final API by an higher-level python wrapper, that handles previews by addon, and automatically release them on deletion.
Definition in file bpy_utils_previews.cc.
| #define STR_SOURCE_TYPES "'IMAGE', 'MOVIE', 'BLEND', 'FONT'" |
Definition at line 33 of file bpy_utils_previews.cc.
|
static |
Definition at line 86 of file bpy_utils_previews.cc.
References BKE_previewimg_cached_thumbnail_read(), ptr, PyC_ParseStringEnum(), PyC_ParseUnicodeAsBytesAndSize(), pyrna_struct_CreatePyObject(), RNA_pointer_create(), THB_SOURCE_BLEND, THB_SOURCE_FONT, THB_SOURCE_IMAGE, THB_SOURCE_MOVIE, THB_SOURCE_OBJECT_IO, PyC_UnicodeAsBytesAndSize_Data::value, PyC_UnicodeAsBytesAndSize_Data::value_coerce, and PyC_StringEnum::value_found.
| PyObject * BPY_utils_previews_module | ( | ) |
Definition at line 182 of file bpy_utils_previews.cc.
References bpy_utils_previews_module.
Referenced by BPy_init_modules().
|
static |
Definition at line 49 of file bpy_utils_previews.cc.
References BKE_previewimg_cached_ensure(), ptr, pyrna_struct_CreatePyObject(), and RNA_pointer_create().
|
static |
Definition at line 141 of file bpy_utils_previews.cc.
References BKE_previewimg_cached_release().
| PyDoc_STRVAR | ( | bpy_utils_previews_doc | , |
| "This object contains basic static methods to handle cached (non-ID) previews in Blender\n" "(low-level API, not exposed to final users)." | ) |
| PyDoc_STRVAR | ( | bpy_utils_previews_load_doc | , |
| ".. method:: load(name, filepath, filetype, force_reload=False)\n" "\n" " Generate a new preview from given file path.\n" "\n" " :arg name: The name (unique id) identifying the preview.\n" " :type name: str\n" " :arg filepath: The file path to generate the preview from.\n" " :type filepath: str | bytes\n" " :arg filetype: The type of | file, | ||
| needed to generate the preview in .\n" " :type filetype:str\n" " :arg force_reload:If | True[" STR_SOURCE_TYPES "], | ||
| force running thumbnail manager even if preview already " "exists in cache.\n" " :type force_reload:bool\n" " :return:The Preview matching given | name, | ||
| or a new empty one.\n" " :rtype::class:`bpy.types.ImagePreview`\n" " :raises KeyError:if ``name`` already exists." | ) |
| PyDoc_STRVAR | ( | bpy_utils_previews_new_doc | , |
| ".. method:: new(name)\n" "\n" " Generate a new empty preview.\n" "\n" " :arg name: The name (unique id) identifying the preview.\n" " :type name: str\n" " :return: The Preview matching given | name, | ||
| or a new empty one.\n" " :rtype::class:`bpy.types.ImagePreview`\n" " :raises KeyError:if ``name`` already exists." | ) |
| PyDoc_STRVAR | ( | bpy_utils_previews_release_doc | , |
| ".. method:: release(name)\n" "\n" " Release (free) a previously created preview.\n" "\n" "\n" " :arg name: The name (unique id) identifying the preview.\n" " :type name: str\n" | ) |
|
static |
Definition at line 154 of file bpy_utils_previews.cc.
|
static |
Definition at line 170 of file bpy_utils_previews.cc.
Referenced by BPY_utils_previews_module().