Transform: Implement Snap to Grid mode #116109

Merged
Germano Cavalcante merged 4 commits from mano-wii/blender:snap_to_grid into main 2024-03-27 13:17:37 +01:00

Addresses two improvements to Snap to Grid as suggested in #73993:

  • Make 'Absolute Grid Snapping' a new Snap Mode
  • Snap to Grid in Non-Side View performed at ground level

Implementation details:

  • Snap to Grid has no snap symbol on the position being snapped, unless we are in Set Snap Base mode. This maintains the old 'Absolute Grid Snap' behavior. And a grid snap indication is not necessary.
  • In Non-Side view, Snap to Grid is done at ground level.
  • If Snap With is Closest, Snap to Grid uses the transform pivot point instead. Tests have shown that Closest is not really useful for Sap to Grid. And this keeps the behavior closer to the previous "Absolute Grid Snap".
  • The old "Absolute Grid Snap" option has been removed.

Snap Menu for View 3D:
View3D_popover.png

Snap Menu for UV:
UV_popover.png

Usage with Set Snap Base:
GIF.gif

Addresses two improvements to `Snap to Grid` as suggested in #73993: - Make 'Absolute Grid Snapping' a new Snap Mode - Snap to Grid in Non-Side View performed at ground level Implementation details: - Snap to Grid has no snap symbol on the position being snapped, unless we are in `Set Snap Base` mode. This maintains the old 'Absolute Grid Snap' behavior. And a grid snap indication is not necessary. - In Non-Side view, Snap to Grid is done at ground level. - If `Snap With` is `Closest`, Snap to Grid uses the transform pivot point instead. Tests have shown that Closest is not really useful for Sap to Grid. And this keeps the behavior closer to the previous "Absolute Grid Snap". - The old "Absolute Grid Snap" option has been removed. --- Snap Menu for View 3D: ![View3D_popover.png](/attachments/f320851b-d096-488c-8374-87f9f583ac8d) Snap Menu for UV: ![UV_popover.png](/attachments/43e6ff49-47e6-4c1c-bfe9-ff4e2138f8e7) Usage with Set Snap Base: ![GIF.gif](/attachments/ded22abe-b035-4cab-a460-47aacf7ca1a9)
Germano Cavalcante requested review from Campbell Barton 2023-12-12 21:14:26 +01:00
Germano Cavalcante requested review from Dalai Felinto 2023-12-12 21:14:26 +01:00
Author
Member

It may be late, but I believe this idea could be added to 'the planning for 2024'.

It may be late, but I believe this idea could be added to 'the planning for 2024'.

Something that is small scoped, doesn't require a team, and even has a patch for it, can be tackled as part of the regular module development. It doesn't need to be in the big-overarching 2024 planning.

Something that is small scoped, doesn't require a team, and even has a patch for it, can be tackled as part of the regular module development. It doesn't need to be in the big-overarching 2024 planning.

"Snap to Grid has no symbol, unless we are in Set Snap Base mode."

What is the rational for showing when in Snap Base mode but not always?

If Snap With is Closest, Snap to Grid uses the transform pivot instead.

That sounds arbritrary. I still think we should get rid of "Closest" once and for all.

> "Snap to Grid has no symbol, unless we are in Set Snap Base mode." What is the rational for showing when in Snap Base mode but not always? > If Snap With is Closest, Snap to Grid uses the transform pivot instead. That sounds arbritrary. I still think we should get rid of "Closest" once and for all.
Author
Member

What is the rational for showing when in Snap Base mode but not always?

It doesn't have a symbol because:

  • Matches the standard seen in industry CAD applications that also do not have a symbol;
  • Keeps the behavior more similar to the now removed 'Absolute Grid Snap';
  • If Snap to Grid is enabled and we do not have snap to another type of element, Snap to Grid is certainly being done, no indication is needed.

It displays a 'Loose Point' symbol in 'Set Snap Base' mode because: since nothing else moves, this is the only way to know if the Base point is on the Grid.

"If Snap With is Closest, Snap to Grid uses the transform pivot instead" sounds arbitrary.

The 'Absolute Grid Snap' behavior (which always used the midpoint) also seemed arbitrary.
I tested Closest and it really isn't useful for Snap to Grid. Especially if we are snapping a UV. Since a UV mesh has many internal points and the Grid is inside it, seemingly random base points are chosen for snapping. Very unpredictable result.
In 3D View the entire object moves to snap to a point that is inside it. And once again the Closest base point appears to be random. It's not useful either.
By changing only the Closest, the Snap to Grid behavior is less restricted than the previous 'Absolute Grid Snap'.

I see it as a plus on the way to making Closest less used and possibly removed in the future.

> What is the rational for showing when in Snap Base mode but not always? It doesn't have a symbol because: - Matches the standard seen in industry CAD applications that also do not have a symbol; - Keeps the behavior more similar to the now removed 'Absolute Grid Snap'; - If Snap to Grid is enabled and we do not have snap to another type of element, Snap to Grid is certainly being done, no indication is needed. It displays a 'Loose Point' symbol in 'Set Snap Base' mode because: since nothing else moves, this is the only way to know if the Base point is on the Grid. > "If Snap With is Closest, Snap to Grid uses the transform pivot instead" sounds arbitrary. The 'Absolute Grid Snap' behavior (which always used the midpoint) also seemed arbitrary. I tested Closest and it really isn't useful for Snap to Grid. Especially if we are snapping a UV. Since a UV mesh has many internal points and the Grid is inside it, seemingly random base points are chosen for snapping. Very unpredictable result. In 3D View the entire object moves to snap to a point that is inside it. And once again the Closest base point appears to be random. It's not useful either. By changing only the Closest, the Snap to Grid behavior is less restricted than the previous 'Absolute Grid Snap'. I see it as a plus on the way to making `Closest` less used and possibly removed in the future.

This seems fine, if user-stakeholders find the solution acceptable I have no objections.
CC'ing @DanielBystedt & @JulienKaspar.

This seems fine, if user-stakeholders find the solution acceptable I have no objections. CC'ing @DanielBystedt & @JulienKaspar.
Germano Cavalcante force-pushed snap_to_grid from 636af938b7 to 75f412cd0b 2024-03-19 12:28:35 +01:00 Compare
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR116109) when ready.
First-time contributor

Wow! Works really, really good from my testing! We will finally be able to snap precisely with Snap Base to the grid and it just works! ❤️

After using this, it feels bad going back to regular Blender Increments + Grid Snap that barley works half of the time haha 😅

I can not wait until it is finally added officially! 🥳4.2 is going to be great! 🎊

Wow! Works really, really good from my testing! We will finally be able to snap precisely with Snap Base to the grid and it just works! ❤️ After using this, it feels bad going back to regular Blender Increments + Grid Snap that barley works half of the time haha 😅 I can not wait until it is finally added officially! 🥳4.2 is going to be great! 🎊
Member

Nice addition! This works very nicely. The only thing that I've found that I'd like to get fixed is that the snapping to grid does not work in conjunction with X-ray mode. Snapping does work with other snapping targets like vertex, edge etc when in x-ray

bild

Nice addition! This works very nicely. The only thing that I've found that I'd like to get fixed is that the snapping to grid does not work in conjunction with X-ray mode. Snapping does work with other snapping targets like vertex, edge etc when in x-ray ![bild](/attachments/904e5ed9-ff22-4600-822a-bfb106025844)
87 KiB
Germano Cavalcante added 3 commits 2024-03-21 02:46:06 +01:00
Merge branch 'main' into snap_to_grid
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
9710a002a7
Author
Member

Nice catch! Fixed now.
@blender-bot package

Nice catch! Fixed now. @blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR116109) when ready.
Member

Works perfectly! Thank you :-)

Works perfectly! Thank you :-)
Daniel Bystedt approved these changes 2024-03-26 00:37:04 +01:00
Germano Cavalcante merged commit f0479e915f into main 2024-03-27 13:17:37 +01:00
Germano Cavalcante deleted branch snap_to_grid 2024-03-27 13:17:39 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
Asset Browser Project
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
6 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#116109
No description provided.