Blender Git Commit Log

Git Commits -> Revision 5171d86

Revision 5171d86 by Hans Goudey (master)
May 26, 2020, 19:39 (GMT)
UI: List Panel System

This implements a general system to implement drag and drop, subpanels,
and UI animation for the stack UIs in Blender. There are NO functional
changes in this patch, but it makes it relatively trivial to implement
these features for stacks.

The biggest complication to using panels to implement the UI for lists
is that there can be multiple modifiers of the same type. Currently there
is an assumed 1 to 1 relationship between every panel and its type, but
there can be multiple list items of the same type, so we have to break
this relationship. The mapping between panels and their data is stored
with an index in the panel's runtime struct.

To make use the system for a list like modifiers, four components
must be added:
1. A panel type defined and registered for each list data type, with a
known mapping between list data types and panel idnames.
1. A function called by interface code to build the add the panel
layouts with the provided helper functions.
- UI_panel_list_matches_data will check if the panel list needs to
be rebuilt.
- UI_panels_free_instanced will remove the existing list panels
- UI_panel_add_instanced adds a list panel of a given type.
3. An expand flag for the list data and implementations of
get_list_data_expand_flag and set_list_data_expand_flag.
4. For reordering, the panel type's reorder callback. This is called
when the instanced panels are drag-dropped. This requires
implementing a "move to index" operator for the list data.

Reviewed By: Severin, brecht

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

Commit Details:

Full Hash: 5171d86806a338aa885cdddf3ad83dfcf15c40aa
Parent Commit: de257b6
Lines Changed: +658, -53

9 Modified Paths:

/source/blender/blenkernel/BKE_screen.h (+19, -0) (Diff)
/source/blender/editors/include/UI_interface.h (+21, -0) (Diff)
/source/blender/editors/interface/interface_align.c (+2, -2) (Diff)
/source/blender/editors/interface/interface_intern.h (+1, -0) (Diff)
/source/blender/editors/interface/interface_panel.c (+461, -36) (Diff)
/source/blender/editors/interface/interface_widgets.c (+25, -1) (Diff)
/source/blender/editors/screen/area.c (+96, -10) (Diff)
/source/blender/makesdna/DNA_screen_types.h (+16, -4) (Diff)
/source/blender/makesrna/intern/rna_ui.c (+17, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021