Weight Paint gradient operators wait for mouse input #111007

Open
opened 2023-08-10 15:21:38 +02:00 by Julien Kaspar · 2 comments
Member

System Information
Operating system: Linux-6.4.6-gentoo-x86_64-AMD_Ryzen_Threadripper_1950X_16-Core_Processor-with-glibc2.37 64 Bits, X11 UI
Graphics card: AMD Radeon RX 7900 XT (gfx1100, LLVM 15.0.7, DRM 3.52, 6.4.6-gentoo) AMD 4.6 (Core Profile) Mesa 23.3.0-devel (git-50c29e1ffa)

Blender Version
Broken: version: 4.0.0 Alpha, branch: main, commit date: 2023-08-09 23:29, hash: 49064a96bc82
Worked: --

Short description of error
This is based on feedback from #108791
When using the gradient operators in weight paint mode, they don't start on shortcut press but require a mouse press to start and release to confirm.

This worked well with the previous default shortcut with mouse clicks but when reassigned to keyboard shortcuts this is very inconsistent with other operators in Blender and seems unintentional or outdated.

A good counter example for a better behavior is "Expand by Topology" in sculpt mode, which only waits for mouse input if started from a menu. If executed with the keyboad shortcut Shift A it will start and then confirm with LMB.
If the shortcut is remapped to a mouse press, it will start on press and confirm with release.

Exact steps for others to reproduce the error

  • Enter Weight Paint Mode
  • Press Shift A and use the operation
  • Try the same in Sculpt Mode
**System Information** Operating system: Linux-6.4.6-gentoo-x86_64-AMD_Ryzen_Threadripper_1950X_16-Core_Processor-with-glibc2.37 64 Bits, X11 UI Graphics card: AMD Radeon RX 7900 XT (gfx1100, LLVM 15.0.7, DRM 3.52, 6.4.6-gentoo) AMD 4.6 (Core Profile) Mesa 23.3.0-devel (git-50c29e1ffa) **Blender Version** Broken: version: 4.0.0 Alpha, branch: main, commit date: 2023-08-09 23:29, hash: `49064a96bc82` Worked: -- **Short description of error** This is based on feedback from #108791 When using the gradient operators in weight paint mode, they don't start on shortcut press but require a mouse press to start and release to confirm. This worked well with the previous default shortcut with mouse clicks but when reassigned to keyboard shortcuts this is very inconsistent with other operators in Blender and seems unintentional or outdated. A good counter example for a better behavior is "Expand by Topology" in sculpt mode, which only waits for mouse input if started from a menu. If executed with the keyboad shortcut `Shift A` it will start and then confirm with `LMB`. If the shortcut is remapped to a mouse press, it will start on press and confirm with release. **Exact steps for others to reproduce the error** - Enter Weight Paint Mode - Press `Shift A` and use the operation - Try the same in Sculpt Mode
Iliya Katushenock added
Interest
Modeling
Interest
User Interface
and removed
Interest
Animation & Rigging
labels 2023-08-10 15:34:13 +02:00
Iliya Katushenock added
Module
Modeling
Status
Confirmed
and removed
Status
Needs Triage
Interest
Modeling
labels 2023-08-11 01:23:23 +02:00
Member

I can confirm.
Removing hardcoded if() fixes this:

diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.cc b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.cc
index c1207cbfb19..500550757d1 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.cc
+++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.cc
@@ -877,10 +877,8 @@ static int paint_weight_gradient_invoke(bContext *C, wmOperator *op, const wmEve
     ARegion *region = CTX_wm_region(C);
     if (region->regiontype == RGN_TYPE_WINDOW) {
       /* TODO: hard-coded, extend `WM_gesture_straightline_*`. */
-      if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
-        wmGesture *gesture = static_cast<wmGesture *>(op->customdata);
-        gesture->is_active = true;
-      }
+      wmGesture *gesture = static_cast<wmGesture *>(op->customdata);
+      gesture->is_active = true;
     }
   }

I did not exactly understand the TODO "hard-coded, extend WM_gesture_straightline_*. */" @ideasman42 added in 5553037be7 😅

I can confirm. Removing hardcoded `if()` fixes this: ```Diff diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.cc b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.cc index c1207cbfb19..500550757d1 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.cc +++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.cc @@ -877,10 +877,8 @@ static int paint_weight_gradient_invoke(bContext *C, wmOperator *op, const wmEve ARegion *region = CTX_wm_region(C); if (region->regiontype == RGN_TYPE_WINDOW) { /* TODO: hard-coded, extend `WM_gesture_straightline_*`. */ - if (event->type == LEFTMOUSE && event->val == KM_PRESS) { - wmGesture *gesture = static_cast<wmGesture *>(op->customdata); - gesture->is_active = true; - } + wmGesture *gesture = static_cast<wmGesture *>(op->customdata); + gesture->is_active = true; } } ``` I did not exactly understand the TODO "`hard-coded, extend WM_gesture_straightline_*. */`" @ideasman42 added in 5553037be7c5c590b1e21741dc3c0f6fad49f480 😅
Author
Member

@ideasman42 Do you have a bit of time to look into this during Bcon2/3?
Right now this is a very noticeable issue with the new keymap changes.

@ideasman42 Do you have a bit of time to look into this during Bcon2/3? Right now this is a very noticeable issue with the new keymap changes.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#111007
No description provided.