Toggling snapping during transform does not update header icon #72088

Closed
opened 2019-12-01 12:07:28 +01:00 by Stanislav Blinov · 19 comments

Broken: 2.81, 2.82

Short description of error
If during a transform you use the modal shortcut to toggle snapping, the snapping icon in the header will not update its state, even after the transform is confirmed or cancelled. It will update if you hover mouse pointer over it though.

Exact steps for others to reproduce the error

  1. Load the default scene.
  2. Start moving the cube and press the snap toggle shortcut (shift+tab in default keymap)
  3. Complete or cancel the transform.
  4. Hover mouse pointer over the snap icon in the header.
Broken: 2.81, 2.82 **Short description of error** If during a transform you use the modal shortcut to toggle snapping, the snapping icon in the header will not update its state, even after the transform is confirmed or cancelled. It will update if you hover mouse pointer over it though. **Exact steps for others to reproduce the error** 1. Load the default scene. 2. Start moving the cube and press the snap toggle shortcut (shift+tab in default keymap) 3. Complete or cancel the transform. 4. Hover mouse pointer over the snap icon in the header.

Added subscriber: @Stan_Pancakes

Added subscriber: @Stan_Pancakes

#76943 was marked as duplicate of this issue

#76943 was marked as duplicate of this issue

#76054 was marked as duplicate of this issue

#76054 was marked as duplicate of this issue

#75816 was marked as duplicate of this issue

#75816 was marked as duplicate of this issue

#74799 was marked as duplicate of this issue

#74799 was marked as duplicate of this issue

Added subscriber: @AnthonyEdlin

Added subscriber: @AnthonyEdlin

Hi, thanks for report.

Can confirm that it doesn't update button drawing until you hover over.

saveTransform saves the snap state back to the toolsettings but doesn't force any redraw. If I add a ED_area_tag_redraw then it updates as it should, but not sure if we should use that or other transform redraw functions.

Hi, thanks for report. Can confirm that it doesn't update button drawing until you hover over. saveTransform saves the snap state back to the toolsettings but doesn't force any redraw. If I add a ED_area_tag_redraw then it updates as it should, but not sure if we should use that or other transform redraw functions.
Member

Added subscribers: @mano-wii, @lichtwerk

Added subscribers: @mano-wii, @lichtwerk
Member

@AnthonyEdlin: I guess that would work. This is doing it after confirmation/cancellation, right? Do you have a way to redraw immediately, too?

CC @mano-wii

@AnthonyEdlin: I guess that would work. This is doing it after confirmation/cancellation, right? Do you have a way to redraw immediately, too? CC @mano-wii

@lichtwerk I look into transfering setting back into toolsettings right in the modal event handling of TFM_MODAL_SNAP_TOGGLE with this patch:#72088.diff

It kind of works, but in doing this I run into a bunch of problems, plus expanded scope of this bug.

  1. Toolsettings and transform are used by many editors including nodes editor, video sequencer, UV editor, 3d view. If I redraw in the 3d view the button for snapping it still doesn't redraw the ones on other editors until you hover over their areas. So what to do, update whole interface? Is there some notifier for when toolsettings changed that could be used? Some editors like sequencer use snapping but toggle doesn't do anything in that editor but it will toggle the other editors snapping, so have to check which editors it's useful for.

  2. It's not just snapping that has this problem. If you have proportional editing turned on you can press shift+O to toggle falloff type and alt+C to toggle connected inside transform operator. If you do either of these they have same problem as snapping toggle, the buttons in header only update once you hover over it. Same for UV editor proportional edit buttons.

  3. There are some weird transform options you can set in 3d view that don't really make sense and transform operator kind of just ignores in some cases. You can turn transform affect off for all of Move, Rotate, and Scale but you can still have snapping on? If you have only affect move toggled on with snapping on and you start a move with G but then switch to rotation with R, snapping is still on, even though settings has it off for rotation. With same settings if you start a rotation with R, snapping won't be on, then you press G and it will be on, then you press R and it's still on. So are settings just what a transform should start with and then can toggle if you want or? Seems right now you can toggle some and they are saved but some others and they are not saved. We don't save if you switch from global to local orientations.

So there are several things that need to be fixed here but I'm not sure anymore what is correct. To update the toolsettings dynamically from modal events? To only save out toolsettings at end in saveTransform and update whole interface? To not save out toolsettings because it just messes around with defaults? A mix of different options based on what toolsetting it is? Maybe UI team has a consensus here?

@lichtwerk I look into transfering setting back into toolsettings right in the modal event handling of TFM_MODAL_SNAP_TOGGLE with this patch:[#72088.diff](https://archive.blender.org/developer/F8185401/T72088.diff) It kind of works, but in doing this I run into a bunch of problems, plus expanded scope of this bug. 1. Toolsettings and transform are used by many editors including nodes editor, video sequencer, UV editor, 3d view. If I redraw in the 3d view the button for snapping it still doesn't redraw the ones on other editors until you hover over their areas. So what to do, update whole interface? Is there some notifier for when toolsettings changed that could be used? Some editors like sequencer use snapping but toggle doesn't do anything in that editor but it will toggle the other editors snapping, so have to check which editors it's useful for. 2. It's not just snapping that has this problem. If you have proportional editing turned on you can press shift+O to toggle falloff type and alt+C to toggle connected inside transform operator. If you do either of these they have same problem as snapping toggle, the buttons in header only update once you hover over it. Same for UV editor proportional edit buttons. 3. There are some weird transform options you can set in 3d view that don't really make sense and transform operator kind of just ignores in some cases. You can turn transform affect off for all of Move, Rotate, and Scale but you can still have snapping on? If you have only affect move toggled on with snapping on and you start a move with G but then switch to rotation with R, snapping is still on, even though settings has it off for rotation. With same settings if you start a rotation with R, snapping won't be on, then you press G and it will be on, then you press R and it's still on. So are settings just what a transform should start with and then can toggle if you want or? Seems right now you can toggle some and they are saved but some others and they are not saved. We don't save if you switch from global to local orientations. So there are several things that need to be fixed here but I'm not sure anymore what is correct. To update the toolsettings dynamically from modal events? To only save out toolsettings at end in saveTransform and update whole interface? To not save out toolsettings because it just messes around with defaults? A mix of different options based on what toolsetting it is? Maybe UI team has a consensus here?
Member

Is there some notifier for when toolsettings changed that could be used?

we could do
P1178: T72088_snippet



diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 74fc1406795..c2be9b7ef20 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -2172,6 +2172,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
       else {
         ts->snap_flag &= ~SCE_SNAP;
       }
+      WM_event_add_notifier(C, NC_SCENE | ND_TOOLSETTINGS, NULL);
     }
   }
 

(but that only kicks in on confirmation/cancellation as well -- maybe it is OK though, better than nothing)
Havent checked the other stuff, might have time tomorrow...

> Is there some notifier for when toolsettings changed that could be used? we could do [P1178: T72088_snippet](https://archive.blender.org/developer/P1178.txt) ``` diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 74fc1406795..c2be9b7ef20 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2172,6 +2172,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) else { ts->snap_flag &= ~SCE_SNAP; } + WM_event_add_notifier(C, NC_SCENE | ND_TOOLSETTINGS, NULL); } } ``` (but that only kicks in on confirmation/cancellation as well -- maybe it is OK though, better than nothing) Havent checked the other stuff, might have time tomorrow...

@lichtwerk Yes I think this is probably the best solution for now. ND_TOOLSETTINGS at least will update multiple headers and not whole areas. You will want to do something similar just above that code were it saves out proportional editing toolsettings also. At least now the button display will not be stale.

I'm still not sure how I feel about saving these settings outside of transform but not other settings. It's kind of weird now it only saves it out if the transform mode matches the snapping affects move, rotate, or scale is on. By the default of only affect move being on for snapping, if you press G first and then R to switch to rotation and then shift+TAB to turn on snapping it will snap in the transform operator but it will not save it out. I guess it's always been that way so people are used to how it works, or it just doesn't matter that much.

@lichtwerk Yes I think this is probably the best solution for now. ND_TOOLSETTINGS at least will update multiple headers and not whole areas. You will want to do something similar just above that code were it saves out proportional editing toolsettings also. At least now the button display will not be stale. I'm still not sure how I feel about saving these settings outside of transform but not other settings. It's kind of weird now it only saves it out if the transform mode matches the snapping affects move, rotate, or scale is on. By the default of only affect move being on for snapping, if you press G first and then R to switch to rotation and then shift+TAB to turn on snapping it will snap in the transform operator but it will not save it out. I guess it's always been that way so people are used to how it works, or it just doesn't matter that much.
Member

Added subscriber: @Keavon

Added subscriber: @Keavon
Member

Added subscriber: @iWaraxe

Added subscriber: @iWaraxe
Member

Added subscribers: @3di, @dupoxy

Added subscribers: @3di, @dupoxy
Member

Added subscriber: @Pasang

Added subscriber: @Pasang

This issue was referenced by 81f817e7b4

This issue was referenced by 81f817e7b453548f748e3e8581c95547d3978400

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Campbell Barton self-assigned this 2020-06-02 10:05:55 +02:00

In #72088#822749, @AnthonyEdlin wrote:
2. It's not just snapping that has this problem. If you have proportional editing turned on you can press shift+O to toggle falloff type and alt+C to toggle connected inside transform operator. If you do either of these they have same problem as snapping toggle, the buttons in header only update once you hover over it. Same for UV editor proportional edit buttons.

As mentioned in the discussion, proportional editing falloff can be changed with shift+O and connected can be toggled with alt+C. This has the same problem with header icon updating as the snapping icon, but this patch didn't address this.

These keys are part of the builtin hard-coded keys and not part of the transform modal keymap, so they are kind of hidden to users. Possibly you could just remove them and no one will notice.

> In #72088#822749, @AnthonyEdlin wrote: > 2. It's not just snapping that has this problem. If you have proportional editing turned on you can press shift+O to toggle falloff type and alt+C to toggle connected inside transform operator. If you do either of these they have same problem as snapping toggle, the buttons in header only update once you hover over it. Same for UV editor proportional edit buttons. As mentioned in the discussion, proportional editing falloff can be changed with shift+O and connected can be toggled with alt+C. This has the same problem with header icon updating as the snapping icon, but this patch didn't address this. These keys are part of the builtin hard-coded keys and not part of the transform modal keymap, so they are kind of hidden to users. Possibly you could just remove them and no one will notice.
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
7 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#72088
No description provided.