Blender Git Loki

Git Commits -> Revision 59b2acc

Revision 59b2acc by Bastien Montagne (master)
August 27, 2015, 14:00 (GMT)
Make .blend file thumbnail reading simpler and more coherent, read/store them when reading in background mode.

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).
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). RNA API for this was not added though,
accessing that kind of .blend meta-data has to be rethought a bit on a bigger level first.

Reviewers: sergey, campbellbarton

Subscribers: Severin, psy-fi

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

Commit Details:

Full Hash: 59b2acc71b996ebf30ce643a188317605d5a971f
Parent Commit: 987b3df
Lines Changed: +270, -132

10 Modified Paths:

/source/blender/blenkernel/BKE_library.h (+6, -0) (Diff)
/source/blender/blenkernel/BKE_main.h (+13, -1) (Diff)
/source/blender/blenkernel/intern/library.c (+73, -0) (Diff)
/source/blender/blenloader/BLO_blend_defs.h (+2, -0) (Diff)
/source/blender/blenloader/BLO_readfile.h (+10, -0) (Diff)
/source/blender/blenloader/BLO_writefile.h (+3, -3) (Diff)
/source/blender/blenloader/intern/readfile.c (+107, -0) (Diff)
/source/blender/blenloader/intern/writefile.c (+14, -5) (Diff)
/source/blender/imbuf/intern/thumbs_blend.c (+13, -96) (Diff)
/source/blender/windowmanager/intern/wm_files.c (+29, -27) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021