From d30f664c0438e8378c79d5beb114b1338d0e1d94 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 11 May 2015 16:29:12 +0200 Subject: Expose PreviewImage & custom icons to py API. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit mainly: * Exposes PreviewImage struct in RNA, including ways for user to set images data. * Adds a new kind of PreviewImage, using a file path and IMB_thumb to get image. * Adds a new kind of custom icon using PreviewImage, unrelated to ID previews system. * Adds a python API (utils.previews) to allow python scripts to access those custom previews/icons. Note that loading image from files' thumbnails is done when needed (deferred loading), not when defining the custom preview/icon. WARNING: for release addons who would want to use this, please keep it to a strict minimum, really needed level. We do not want our UI to explode under hundreds of different flashy icons! For more info, see also the release notes of Blender 2.75 (http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.75/Addons) and the example/templates featured with Blender. Patch by Campbell (ideasman42), InĂªs (brita) and Bastien (mont29). Differential Revision: https://developer.blender.org/D1255 --- source/blender/imbuf/IMB_thumbs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/imbuf/IMB_thumbs.h') diff --git a/source/blender/imbuf/IMB_thumbs.h b/source/blender/imbuf/IMB_thumbs.h index f977a633c57..2cb56832a00 100644 --- a/source/blender/imbuf/IMB_thumbs.h +++ b/source/blender/imbuf/IMB_thumbs.h @@ -61,6 +61,8 @@ typedef enum ThumbSource { /* don't generate thumbs for images bigger then this (100mb) */ #define THUMB_SIZE_MAX (100 * 1024 * 1024) +#define PREVIEW_RENDER_DEFAULT_HEIGHT 128 + /* create thumbnail for file and returns new imbuf for thumbnail */ ImBuf *IMB_thumb_create(const char *path, ThumbSize size, ThumbSource source, ImBuf *ibuf); -- cgit v1.2.3