From c61e25e6ac37296c13c0949b8363cc168125d750 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 24 May 2010 21:52:18 +0000 Subject: blend file thumbnailing - uses same thumbnail system as image browser - blend files show thumbnails in ubuntu/gnome (freedesktop spec) - 128x128 images are embedded into the blend file header, a simple loader avoids reading the entire blend file to extract it when generating thumbnails in the file selector. When the image browser reads a directory it loads images and creates thumbnails, blend files embedded images are treated just like loading an image. - the thumbnail is created from the camera view in solid mode. (no camera == no thumbnal). - readfile/writefile.c: had to use the 'TEST' code name to save thumbnails, anything else would segfault older blender versions on load. (its not used elsewhere). --- source/blender/imbuf/IMB_thumbs.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (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 c7e39b9e0d7..ecb0ba8abd1 100644 --- a/source/blender/imbuf/IMB_thumbs.h +++ b/source/blender/imbuf/IMB_thumbs.h @@ -50,13 +50,14 @@ typedef enum ThumbSize { typedef enum ThumbSource { THB_SOURCE_IMAGE, - THB_SOURCE_MOVIE + THB_SOURCE_MOVIE, + THB_SOURCE_BLEND } ThumbSource; // IB_metadata /* create thumbnail for file and returns new imbuf for thumbnail */ -ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source); +ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, ImBuf *ibuf); /* read thumbnail for file and returns new imbuf for thumbnail */ ImBuf* IMB_thumb_read(const char* path, ThumbSize size); @@ -70,6 +71,8 @@ ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source); /* create the necessary dirs to store the thumbnails */ void IMB_thumb_makedirs(); +/* special function for loading a thumbnail embedded into a blend file */ +ImBuf *IMB_loadblend_thumb(const char *path); #endif /* _IMB_THUMBS_H */ -- cgit v1.2.3