Blender Git Loki

Git Commits -> Revision 7504cf3

Revision 7504cf3 by Bastien Montagne (master)
December 28, 2012, 09:20 (GMT)
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).

It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!

This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!

To make all this work, other changes were also necessary:

* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.

* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.

* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.

* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?

Note: will update addons using template list asap.

Commit Details:

Full Hash: 7504cf34b470bec3b3fc7239d655738a09ed7624
SVN Revision: 53355
Parent Commit: 7730ddb
Lines Changed: +974, -457

36 Modified Paths:

/release/scripts/modules/bpy_types.py (+4, -0) (Diff)
/release/scripts/startup/bl_ui/properties_data_armature.py (+2, -2) (Diff)
/release/scripts/startup/bl_ui/properties_data_mesh.py (+57, -5) (Diff)
/release/scripts/startup/bl_ui/properties_mask_common.py (+20, -3) (Diff)
/release/scripts/startup/bl_ui/properties_material.py (+22, -2) (Diff)
/release/scripts/startup/bl_ui/properties_particle.py (+5, -5) (Diff)
/release/scripts/startup/bl_ui/properties_physics_common.py (+1, -1) (Diff)
/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py (+25, -2) (Diff)
/release/scripts/startup/bl_ui/properties_render.py (+20, -2) (Diff)
/release/scripts/startup/bl_ui/properties_scene.py (+16, -3) (Diff)
/release/scripts/startup/bl_ui/properties_texture.py (+19, -2) (Diff)
/release/scripts/startup/bl_ui/space_clip.py (+15, -4) (Diff)
/release/scripts/startup/bl_ui/space_view3d_toolbar.py (+4, -2) (Diff)
/release/scripts/startup/bl_ui/__init__.py (+6, -0) (Diff)
/source/blender/blenkernel/BKE_screen.h (+18, -0) (Diff)
/source/blender/blenloader/intern/readfile.c (+8, -1) (Diff)
/source/blender/blenloader/intern/writefile.c (+4, -0) (Diff)
/source/blender/editors/include/UI_interface.h (+5, -2) (Diff)
/source/blender/editors/include/UI_interface_icons.h (+3, -0) (Diff)
/source/blender/editors/interface/interface_handlers.c (+45, -42) (Diff)
/source/blender/editors/interface/interface_icons.c (+39, -0) (Diff)
/source/blender/editors/interface/interface_intern.h (+3, -0) (Diff)
/source/blender/editors/interface/interface_layout.c (+4, -1) (Diff)
/source/blender/editors/interface/interface_templates.c (+169, -343) (Diff)
/source/blender/editors/space_node/drawnode.c (+2, -2) (Diff)
/source/blender/makesdna/DNA_screen_types.h (+26, -4) (Diff)
/source/blender/makesrna/intern/rna_dynamicpaint.c (+22, -0) (Diff)
/source/blender/makesrna/intern/rna_ui.c (+164, -0) (Diff)
/source/blender/makesrna/intern/rna_ui_api.c (+170, -24) (Diff)
/source/blender/makesrna/RNA_access.h (+1, -1) (Diff)
/source/blender/makesrna/RNA_enum_types.h (+3, -0) (Diff)
/source/blender/python/intern/bpy_rna.c (+3, -2) (Diff)
/source/blender/windowmanager/intern/wm.c (+57, -1) (Diff)
/source/blender/windowmanager/intern/wm_init_exit.c (+2, -0) (Diff)
/source/blender/windowmanager/WM_api.h (+7, -0) (Diff)
/source/blenderplayer/bad_level_call_stubs/stubs.c (+3, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021