Blender Git Commit Log

Git Commits -> Revision d30f664

Revision d30f664 by Bastien Montagne (master)
May 11, 2015, 14:37 (GMT)
Expose PreviewImage & custom icons to py API.

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

Commit Details:

Full Hash: d30f664c0438e8378c79d5beb114b1338d0e1d94
Parent Commit: e38f914
Lines Changed: +1424, -239

5 Added Paths:

/release/scripts/modules/bpy/utils/previews.py (+137, -0) (View)
/release/scripts/templates_py/ui_previews_custom_icon.py (+82, -0) (View)
/release/scripts/templates_py/ui_previews_dynamic_enum.py (+136, -0) (View)
/source/blender/python/intern/bpy_utils_previews.c (+188, -0) (View)
/source/blender/python/intern/bpy_utils_previews.h (+32, -0) (View)

27 Modified Paths:

/release/scripts/modules/bpy/utils/__init__.py (+1, -0) (Diff)
/source/blender/blenkernel/BKE_icons.h (+33, -5) (Diff)
/source/blender/blenkernel/intern/icons.c (+274, -68) (Diff)
/source/blender/blenkernel/intern/image.c (+2, -2) (Diff)
/source/blender/blenkernel/intern/lamp.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/material.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/texture.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/world.c (+1, -1) (Diff)
/source/blender/editors/include/ED_render.h (+7, -3) (Diff)
/source/blender/editors/include/UI_interface_icons.h (+1, -1) (Diff)
/source/blender/editors/interface/interface.c (+22, -19) (Diff)
/source/blender/editors/interface/interface_icons.c (+115, -36) (Diff)
/source/blender/editors/interface/interface_intern.h (+3, -0) (Diff)
/source/blender/editors/interface/interface_templates.c (+6, -8) (Diff)
/source/blender/editors/render/render_preview.c (+88, -61) (Diff)
/source/blender/editors/render/render_update.c (+8, -8) (Diff)
/source/blender/editors/space_image/image_ops.c (+1, -1) (Diff)
/source/blender/imbuf/IMB_thumbs.h (+2, -0) (Diff)
/source/blender/imbuf/intern/thumbs.c (+2, -2) (Diff)
/source/blender/makesdna/DNA_ID.h (+19, -3) (Diff)
/source/blender/makesrna/intern/rna_brush.c (+4, -4) (Diff)
/source/blender/makesrna/intern/rna_ID.c (+236, -0) (Diff)
/source/blender/makesrna/intern/rna_main_api.c (+4, -3) (Diff)
/source/blender/makesrna/RNA_access.h (+1, -0) (Diff)
/source/blender/python/intern/bpy.c (+2, -0) (Diff)
/source/blender/python/intern/CMakeLists.txt (+3, -0) (Diff)
/source/blender/windowmanager/intern/wm_init_exit.c (+11, -11) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021