diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-05-25 01:52:18 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-05-25 01:52:18 +0400 |
commit | c61e25e6ac37296c13c0949b8363cc168125d750 (patch) | |
tree | 2bab770f7158ad937b6b7ccddea6480c8d594d90 /source/blender/editors/space_file/filelist.c | |
parent | 3332b2b29e0b63a9768856c363dda3a4e52f4ce9 (diff) |
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).
Diffstat (limited to 'source/blender/editors/space_file/filelist.c')
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index ebe42219f01..dd23c6b64b2 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1280,6 +1280,8 @@ static void thumbnails_startjob(void *tjv, short *stop, short *do_update) while ( (*stop==0) && (limg) ) { if ( limg->flags & IMAGEFILE ) { limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_IMAGE); + } else if ( limg->flags & BLENDERFILE ) { + limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_BLEND); } else if ( limg->flags & MOVIEFILE ) { limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_MOVIE); if (!limg->img) { @@ -1334,7 +1336,7 @@ void thumbnails_start(struct FileList* filelist, const struct bContext* C) tj->filelist = filelist; for (idx = 0; idx < filelist->numfiles;idx++) { if (!filelist->filelist[idx].image) { - if ( (filelist->filelist[idx].flags & IMAGEFILE) || (filelist->filelist[idx].flags & MOVIEFILE) ) { + if ( (filelist->filelist[idx].flags & (IMAGEFILE|MOVIEFILE|BLENDERFILE)) ) { FileImage* limg = MEM_callocN(sizeof(struct FileImage), "loadimage"); BLI_strncpy(limg->path, filelist->filelist[idx].path, FILE_MAX); limg->index= idx; @@ -1364,4 +1366,4 @@ void thumbnails_stop(struct FileList* filelist, const struct bContext* C) int thumbnails_running(struct FileList* filelist, const struct bContext* C) { return WM_jobs_test(CTX_wm_manager(C), filelist); -}
\ No newline at end of file +} |