Fix #114588: Graph Editor increment snap not working #114607
No reviewers
Labels
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#114607
Loading…
Reference in New Issue
No description provided.
Delete Branch "ChrisLend/blender:fix_graph_editor_snapping"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Here is how this issue came to be.
The regular snapping code has the feature that when you press
Ctrl
you can toggle the snapping on and off.Prior to 4.0 the snapping for the Graph Editor used a completely different system, including a different flag to toggle snapping.
Because of that, the flag that the regular snapping code uses was never set by default. So the system thought it was disabled.
Now when you press
Ctrl
you would enable that flag and the snapping code would run.It would snap to increments because that is the mode that is returned for the Graph Editor space type. (Note that this is the mode of the generic snapping system, not of the Graph Editor specific one)
However at the same time, doing that would disable the Graph Editor specific snapping code.
So the snapped values from the original system would bubble through.
This did not occur in the Dope Sheet and NLA Editor, because those never returned a snapping mode.
Those still have a different behavior to 3.6 where they now snap to seconds, instead of not snapping at all.
The code looks good to me! However, when I tested, it still doesn't completely match the old behavior: in 3.6 holding down ctrl has the described behavior even when snapping is otherwise disabled, whereas with this patch it does nothing. Everything else appears to be working perfectly, though.
@ -133,3 +133,4 @@
/* Those space-types define their own invert behavior instead of toggling it on/off. */
return;
}
if (t->spacetype == SPACE_GRAPH) {
Style: I would make this anelse if
. Or perhaps even better, make the whole thing a switch.Never mind. Apparently
else
after a return is considered bad style in Blender, even in cases like this.Although it deviates a little from the bug fix, we could add the Increment option to the popover.
This way
Snap Invert
would work as it already works in 3D View, UV Editor and Nodes:I attach the path in case the idea seems ok.
@mano-wii This patch is about fixing a regression in behavior, rather than improving the feature. We can look into improving behavior in 4.1.
0c98ffc5c7
to39ee234423
Fix #114588: Graph Editor increment snap not workingto Fix #114588: Graph Editor increment snap not workingI've tested this out, and everything works as expected. The code also looks about as good to me as I think can be done given the broader snapping code it's working within.