Blender Git Commit Log

Git Commits -> Revision d141442

Revision d141442 by Bastien Montagne (blend-thumbnail)
August 27, 2015, 08:36 (GMT)
Make .blend file thumbnail reading simpler and more coherent, read/store them when reading in background mode, and allow user to define custom thumbnails.

Primary goal of this commit is to fix an annoying issue - when processing and saving .blend
files in background mode you lose their thumbnails, since it can only be generated with
an OpenGL context.

Solution to that is to read .blend thumbnail while reading .blend file (only done in background
mode currently), and store it in Main struct.

Also, this lead to removing .blend file reading code from thumb_blend (no need to have doublons,
and always hated that piece of unreadable geeky code there anyway). We now have a small
interface in regular reading code area, which keeps it reasonbaly light by only reading/parsing
header info, and first few BHead blocks.

This makes code reading .blend thumbnail about 3 to 4 times slower than previous highly specialized
one in blend_thumb.c, but overall thumbnail generation of a big .blend files folder only grows
of about 1%, think we can bare with it.

Finally, since thumbnail is now optionally stored in Main struct, it makes it easy to allow user
to define their own custom one (instead of auto-generated one), either by generating it from a
specific scene, or giving it a raw array of pixels.

Reviewers: sergey, campbellbarton

Subscribers: Severin, psy-fi

Differential Revision: https://developer.blender.org/D1469

Commit Details:

Full Hash: d141442bd125fa68c6e029e6383e5cacc96087fa
Parent Commit: 74c3eba
Lines Changed: +347, -127

11 Modified Paths:

/source/blender/blenkernel/BKE_library.h (+5, -0) (Diff)
/source/blender/blenkernel/BKE_main.h (+6, -1) (Diff)
/source/blender/blenkernel/intern/library.c (+73, -0) (Diff)
/source/blender/blenloader/BLO_readfile.h (+9, -0) (Diff)
/source/blender/blenloader/BLO_writefile.h (+0, -2) (Diff)
/source/blender/blenloader/intern/readfile.c (+98, -0) (Diff)
/source/blender/imbuf/intern/thumbs_blend.c (+12, -96) (Diff)
/source/blender/makesrna/intern/rna_main.c (+58, -0) (Diff)
/source/blender/makesrna/intern/rna_main_api.c (+55, -3) (Diff)
/source/blender/windowmanager/intern/wm_files.c (+27, -25) (Diff)
/source/blenderplayer/bad_level_call_stubs/stubs.c (+4, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021