[Bf-blender-cvs] [b6e84d3edff] blender-v2.91-release: Fix T83020: Transform: AutoConstraint being confirmed without releasing the MMB

Germano Cavalcante noreply at git.blender.org
Wed Jan 13 15:08:44 CET 2021


Commit: b6e84d3edffde553d6dd58bbc48ba77bef01625e
Author: Germano Cavalcante
Date:   Thu Nov 26 11:42:13 2020 -0300
Branches: blender-v2.91-release
https://developer.blender.org/rBb6e84d3edffde553d6dd58bbc48ba77bef01625e

Fix T83020: Transform: AutoConstraint being confirmed without releasing the MMB

The transform modifiers are confirmed by releasing any button.

Thus, the operation can be falsely confirmed if the button that launched
the operation is released after the modifier has been activated.

Previously the events that confirmed the modifiers were hardcoded.

An option to fix this would be to add custom confirmation keyitens for
specific modifiers. But this can be a bit confusing and would make the
modal keymap even bigger.

So the solution here is to skip the button that launched the operation
when confirming the modifier.

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

M	source/blender/editors/transform/transform.c

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

diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 5aed4b9c6ef..ad4e12dc9e1 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1203,7 +1203,24 @@ int transformEvent(TransInfo *t, const wmEvent *event)
           handled = true;
         }
         break;
+      case EVENT_NONE:
+      case INBETWEEN_MOUSEMOVE:
+      case INPUTCHANGE:
+      case WINDEACTIVATE:
+      case TIMER:
+      case TIMERJOBS:
+      case TIMERAUTOSAVE:
+      case TIMERREPORT:
+      case TIMERREGION:
+      case TIMERNOTIFIER:
+      case TIMERF:
+        /* Although rare, prevent these events from affecting the state of the modifiers. */
+        break;
       default: {
+        if (event->type == t->launch_event) {
+          /* The user can hold the launch button and release it here. */
+          break;
+        }
         /* Disable modifiers. */
         int modifiers = t->modifiers;
         modifiers &= ~MOD_CONSTRAINT_SELECT;



More information about the Bf-blender-cvs mailing list