Data previews: add utils to generate/clear previews.
Not much to add, you can now clear previews from current .blend file, or a set of non-opened files. Likewise, you can generate previews (for mat/tex, objects, groups, scenes, ...).
This commit is contained in:
@@ -50,6 +50,10 @@
|
||||
#include "BKE_blender.h"
|
||||
#include "BKE_global.h"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
|
||||
#include "UI_interface_icons.h"
|
||||
|
||||
#include "../generic/py_capi_utils.h"
|
||||
#include "../generic/python_utildefines.h"
|
||||
|
||||
@@ -298,6 +302,14 @@ static PyObject *bpy_app_driver_dict_get(PyObject *UNUSED(self), void *UNUSED(cl
|
||||
return Py_INCREF_RET(bpy_pydriver_Dict);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(bpy_app_preview_render_size_doc,
|
||||
"Reference size for icon/preview renders (read-only)"
|
||||
);
|
||||
static PyObject *bpy_app_preview_render_size_get(PyObject *UNUSED(self), void *closure)
|
||||
{
|
||||
return PyLong_FromLong((long)UI_preview_render_size(GET_INT_FROM_POINTER(closure)));
|
||||
}
|
||||
|
||||
static PyObject *bpy_app_autoexec_fail_message_get(PyObject *UNUSED(self), void *UNUSED(closure))
|
||||
{
|
||||
return PyC_UnicodeFromByte(G.autoexec_fail);
|
||||
@@ -322,6 +334,9 @@ static PyGetSetDef bpy_app_getsets[] = {
|
||||
{(char *)"tempdir", bpy_app_tempdir_get, NULL, (char *)bpy_app_tempdir_doc, NULL},
|
||||
{(char *)"driver_namespace", bpy_app_driver_dict_get, NULL, (char *)bpy_app_driver_dict_doc, NULL},
|
||||
|
||||
{(char *)"render_icon_size", bpy_app_preview_render_size_get, NULL, (char *)bpy_app_preview_render_size_doc, (void *)ICON_SIZE_ICON},
|
||||
{(char *)"render_preview_size", bpy_app_preview_render_size_get, NULL, (char *)bpy_app_preview_render_size_doc, (void *)ICON_SIZE_PREVIEW},
|
||||
|
||||
/* security */
|
||||
{(char *)"autoexec_fail", bpy_app_global_flag_get, NULL, NULL, (void *)G_SCRIPT_AUTOEXEC_FAIL},
|
||||
{(char *)"autoexec_fail_quiet", bpy_app_global_flag_get, NULL, NULL, (void *)G_SCRIPT_AUTOEXEC_FAIL_QUIET},
|
||||
|
Reference in New Issue
Block a user