|
Blender
V3.3
|
#include <Python.h>#include <structmember.h>#include "BLI_utildefines.h"#include "RNA_access.h"#include "RNA_prototypes.h"#include "RNA_types.h"#include "BPY_extern.h"#include "bpy_rna.h"#include "bpy_utils_previews.h"#include "MEM_guardedalloc.h"#include "IMB_imbuf.h"#include "IMB_imbuf_types.h"#include "IMB_thumbs.h"#include "BKE_icons.h"#include "DNA_ID.h"#include "../generic/python_utildefines.h"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: string\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 *UNUSED(self), 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: string\n" " :arg filepath: The file path to generate the preview from.\n" " :type filepath: string\n" " :arg filetype: The type of file, needed to generate the preview in [" STR_SOURCE_TYPES "].\n" " :type filetype: string\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 *UNUSED(self), 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: string\n") | |
| static PyObject * | bpy_utils_previews_release (PyObject *UNUSED(self), 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 (void) |
Variables | |
| static struct PyMethodDef | bpy_utils_previews_methods [] |
| static struct 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.c.
| #define STR_SOURCE_TYPES "'IMAGE', 'MOVIE', 'BLEND', 'FONT'" |
Definition at line 37 of file bpy_utils_previews.c.
|
static |
Definition at line 89 of file bpy_utils_previews.c.
References BKE_previewimg_cached_thumbnail_read(), NULL, ptr, pyrna_struct_CreatePyObject(), RNA_pointer_create(), STR_SOURCE_TYPES, STREQ, THB_SOURCE_BLEND, THB_SOURCE_FONT, THB_SOURCE_IMAGE, and THB_SOURCE_MOVIE.
| PyObject* BPY_utils_previews_module | ( | void | ) |
Definition at line 176 of file bpy_utils_previews.c.
References bpy_utils_previews_module.
Referenced by BPy_init_modules().
|
static |
Definition at line 52 of file bpy_utils_previews.c.
References BKE_previewimg_cached_ensure(), NULL, ptr, pyrna_struct_CreatePyObject(), and RNA_pointer_create().
|
static |
Definition at line 136 of file bpy_utils_previews.c.
| 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: string\n" " :arg filepath: The file path to generate the preview from.\n" " :type filepath: string\n" " :arg filetype: The type of | file, | ||
| needed to generate the preview in .\n" " :type filetype:string\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: string\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: string\n" | |||
| ) |
|
static |
Definition at line 136 of file bpy_utils_previews.c.
|
static |
Definition at line 160 of file bpy_utils_previews.c.
Referenced by BPY_utils_previews_module().