[Bf-blender-cvs] [2821da5] blender2.8: Enable multi-selection editing by default (Alt-key behavior)

Julian Eisel noreply at git.blender.org
Sun Nov 27 16:59:09 CET 2016


Commit: 2821da5b703fdd7c38b2711c17f675cf01bc1f27
Author: Julian Eisel
Date:   Sun Nov 27 16:28:56 2016 +0100
Branches: blender2.8
https://developer.blender.org/rB2821da5b703fdd7c38b2711c17f675cf01bc1f27

Enable multi-selection editing by default (Alt-key behavior)

This means editing a property will now always affect all selected objects, bones or sequencer strips. Support for this was added in rBdfbb876d4660 but you had to hold the Alt-key to use it. The old behavior of only editing the active object will not be kept like decided in the 2.8 workflow meeting (reports comming). If you only want to edit the active object, you have to deselect others.

There are still a couple of issues to be resolved (listed below), but having it enabled by default helps testing and getting used to it and should motivate us to fix them ;)
To be fixed:
* Give users hint when edits are applied to all objects/bones/strips ("Applying to x objects") - there are ideas but we need to finalize and implement them
* Make it work better in corner cases (material editing, modifier property editing, etc)

Note: Values usually override the initial value of the object/bones/strips, except of number buttons where it depends if you enter the value (absolute override) or drag the value (add value change). This behavior is consistent with multi-button editing.

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

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

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

diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index fc511d6..09ba666 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -184,7 +184,6 @@ typedef struct uiSelectContextStore {
 	uiSelectContextElem *elems;
 	int elems_len;
 	bool do_free;
-	bool is_enabled;
 	/* When set, simply copy values (don't apply difference).
 	 * Rules are:
 	 * - dragging numbers uses delta.
@@ -1159,14 +1158,11 @@ static void ui_multibut_states_apply(bContext *C, uiHandleButtonData *data, uiBl
 				ui_but_execute_begin(C, ar, but, &active_back);
 
 #ifdef USE_ALLSELECT
-				if (data->select_others.is_enabled) {
-					/* init once! */
-					if (mbut_state->select_others.elems_len == 0) {
-						ui_selectcontext_begin(C, but, &mbut_state->select_others);
-					}
-					if (mbut_state->select_others.elems_len == 0) {
-						mbut_state->select_others.elems_len = -1;
-					}
+				if (mbut_state->select_others.elems_len == 0) {
+					ui_selectcontext_begin(C, but, &mbut_state->select_others);
+				}
+				if (mbut_state->select_others.elems_len == 0) {
+					mbut_state->select_others.elems_len = -1;
 				}
 
 				/* needed so we apply the right deltas */
@@ -2054,12 +2050,7 @@ static void ui_apply_but(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
 		else
 #  endif
 		if (data->select_others.elems_len == 0) {
-			wmWindow *win = CTX_wm_window(C);
-			/* may have been enabled before activating */
-			if (data->select_others.is_enabled || IS_ALLSELECT_EVENT(win->eventstate)) {
-				ui_selectcontext_begin(C, but, &data->select_others);
-				data->select_others.is_enabled = true;
-			}
+			ui_selectcontext_begin(C, but, &data->select_others);
 		}
 		if (data->select_others.elems_len == 0) {
 			/* dont check again */
@@ -3048,11 +3039,7 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
 
 #ifdef USE_ALLSELECT
 	if (is_num_but) {
-		if (IS_ALLSELECT_EVENT(win->eventstate)) {
-			data->select_others.is_enabled = true;
-			data->select_others.is_copy = true;
-
-		}
+		data->select_others.is_copy = true;
 	}
 #endif
 
@@ -3652,15 +3639,6 @@ static void ui_block_open_begin(bContext *C, uiBut *but, uiHandleButtonData *dat
 			data->menu->popup = but->block->handle->popup;
 	}
 
-#ifdef USE_ALLSELECT
-	{
-		wmWindow *win = CTX_wm_window(C);
-		if (IS_ALLSELECT_EVENT(win->eventstate)) {
-			data->select_others.is_enabled = true;
-		}
-	}
-#endif
-
 	/* this makes adjacent blocks auto open from now on */
 	//if (but->block->auto_open == 0) but->block->auto_open = 1;
 }




More information about the Bf-blender-cvs mailing list