[Bf-blender-cvs] [a54c30da76d] greasepencil-object: Hacky fix for Mode Switch Pie Menu overflowing to a submenu on GP Objects

Joshua Leung noreply at git.blender.org
Tue Jul 24 07:47:35 CEST 2018


Commit: a54c30da76dca5d73c241ac7815820ff7970ba07
Author: Joshua Leung
Date:   Tue Jul 24 17:47:28 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rBa54c30da76dca5d73c241ac7815820ff7970ba07

Hacky fix for Mode Switch Pie Menu overflowing to a submenu on GP Objects

With the introduction of the GP editing modes to the object/workspace
modes enum, this introduced a number of issues for the Ctrl-Tab mode
switching pie menu, e.g.
 * To access any of the GP Editing modes, you had to first navigate to
   the "More" sub-pie, before being able to see these values. In practice,
   this was tricky to use, and not ideal.
 * Particle Editing mode was also moved into a sub-pie by itself

This was due to the following reasons:
 1) Pie Menus for Enums use the "static" enum define to determine
    where items should go.  This was done to ensure spatial consistency
    of items (e.g. Edit is always in the "east" position).
 2) Each pie menu layout is only allowed to contain 8 items.
    (i.e. so that movements can be less precise, corresponding to the
    main compass directions only)
 3) The nature of the modes menu means that there is never any situation
    where all menu items need to be visible at the same time. Usually,
    there are only between 2-5 items in that menu at a time, and at least
    6 of the items are only valid for a single object type each.

Several other solutions were tried, but this hack is the simplest fix.

===================================================================

M	source/blender/editors/interface/interface_layout.c

===================================================================

diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 82ed4c5acba..89e1a8caec8 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1244,7 +1244,15 @@ void uiItemsFullEnumO(
 		bool free;
 
 		if (ui_layout_is_radial(layout)) {
+			/* XXX: While "_all()" guarantees spatial stability, it's bad when an enum has > 8 items total,
+			 * but only a small subset will ever be shown at once (e.g. Mode Switch menu, after the 
+			 * introduction of GP editing modes)
+			 */
+#if 0
 			RNA_property_enum_items_gettexted_all(block->evil_C, &ptr, prop, &item_array, &totitem, &free);
+#else
+			RNA_property_enum_items_gettexted(block->evil_C, &ptr, prop, &item_array, &totitem, &free);
+#endif
 		}
 		else {
 			RNA_property_enum_items_gettexted(block->evil_C, &ptr, prop, &item_array, &totitem, &free);



More information about the Bf-blender-cvs mailing list