Transform: add feature to edit the 'Snap Base' #104443

Merged
Germano Cavalcante merged 1 commits from mano-wii/blender:snap_base into main 2023-06-03 04:18:55 +02:00

Implements a new modifier key (B) to change the 'Snap Base' during a transformation.

Ref #66424

Implementation Details

  • This feature is only available in the 3D View.
  • This feature is only available for Move, Rotate, Scale, Vert Slide and Edge Slide transform modes.
  • The Snap Base Edit is enabled while we are transforming and we press the key B
  • The Snap Base Edit is confirmed when we press any of the keys: B, LMB, Enter
  • During um operation, if no snap target is set for an element in the scene (Vertex, Edge...), the snap targets to geometry Vertex, Edge, Face, Center of Edge and Perpendicular of Edge are set automatically.
  • Constraint or similar modal features are not available during the Snap Base Edit mode.
  • Text input is not available during the Snap Base Edit mode.
  • A prone snap base point is indicated with an small cursor drawing.

image

Builds

https://builder.blender.org/download/patch/PR104443

Implements a new modifier key (`B`) to change the 'Snap Base' during a transformation. Ref #66424 ## Implementation Details - This feature is only available in the 3D View. - This feature is only available for `Move`, `Rotate`, `Scale`, `Vert Slide` and `Edge Slide` transform modes. - The `Snap Base Edit` is enabled while we are transforming and we press the key `B` - The `Snap Base Edit` is confirmed when we press any of the keys: `B`, `LMB`, `Enter` - During um operation, if no snap target is set for an element in the scene (Vertex, Edge...), the snap targets to geometry Vertex, Edge, Face, Center of Edge and Perpendicular of Edge are set automatically. - Constraint or similar modal features are not available during the `Snap Base Edit` mode. - Text input is not available during the `Snap Base Edit` mode. - A prone snap base point is indicated with an small cursor drawing. --- ![image](/attachments/42b78566-3465-4832-83e9-829adfab2b64) ## Builds https://builder.blender.org/download/patch/PR104443
Germano Cavalcante requested review from Campbell Barton 2023-02-07 23:27:10 +01:00

Just testing if packaging works:

@blender-bot package

Just testing if packaging works: @blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR104443) when ready.
Brecht Van Lommel added this to the Modeling project 2023-02-13 09:20:49 +01:00
Germano Cavalcante force-pushed snap_base from 746455703c to 976e34c659 2023-03-04 02:47:18 +01:00 Compare
Germano Cavalcante force-pushed snap_base from 976e34c659 to 001b09cbd9 2023-03-04 02:54:08 +01:00 Compare
Germano Cavalcante force-pushed snap_base from 001b09cbd9 to 9edfd3356b 2023-03-08 22:45:41 +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/PR104443) when ready.
Member

Would this be merged anytime soon? This is such a life-saver feature for architects

Would this be merged anytime soon? This is such a life-saver feature for architects
First-time contributor

I tested the new build and it works as expected.

I tested the new build and it works as expected.
Germano Cavalcante force-pushed snap_base from 9edfd3356b to 2595a4469d 2023-03-21 00:38:13 +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/PR104443) when ready.
First-time contributor

What's preventing this patch from progressing any further?
Is just awaiting for reviewers availability, or are there still any pending design choices, dependencies or technical considerations?

What's preventing this patch from progressing any further? Is just awaiting for reviewers availability, or are there still any pending design choices, dependencies or technical considerations?
Germano Cavalcante force-pushed snap_base from 2595a4469d to a44895b13a 2023-05-29 14:38:52 +02:00 Compare
Member

When will this get reviewed?

When will this get reviewed?
Author
Member

When will this get reviewed?

Hopefully before the 4.0 release

@blender-bot package

> When will this get reviewed? Hopefully before the 4.0 release @blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR104443) when ready.
Germano Cavalcante force-pushed snap_base from a44895b13a to 09776c904f 2023-05-31 01:27:45 +02:00 Compare
Campbell Barton approved these changes 2023-05-31 13:23:46 +02:00
Campbell Barton left a comment
Owner

Generally works well, running into a crash with edge slide though.

Generally works well, running into a crash with edge slide though.
@ -1246,2 +1279,4 @@
}
break;
case TFM_MODAL_EDIT_SNAP_SOURCE:
if (event->prev_val == KM_PRESS) {

Note what the prev_val means in this context (while it works it's relying on some internals and isn't common usage). Arguably there should be TFM_MODAL_EDIT_SNAP_SOURCE_ENABLE / TFM_MODAL_EDIT_SNAP_SOURCE_DISABLE events to detect press release although I'm not sure this is really needed.

Note what the `prev_val` means in this context (while it works it's relying on some internals and isn't common usage). Arguably there should be `TFM_MODAL_EDIT_SNAP_SOURCE_ENABLE` / `TFM_MODAL_EDIT_SNAP_SOURCE_DISABLE` events to detect press release although I'm not sure this is really needed.
mano-wii marked this conversation as resolved
@ -0,0 +41,4 @@
eSnapTargetOP target_operation_prev;
struct {
void (*apply)(struct TransInfo *t,

Prefer if callbacks use an _fn suffix, especially when mixing data & callbacks in a single struct.

Prefer if callbacks use an `_fn` suffix, especially when mixing data & callbacks in a single struct.
mano-wii marked this conversation as resolved

Noted some minor requests, otherwise LGTM, no extra iterations needed.


Linked ASAN report of crashes in vert and edge slide.

  • Edge slide crash happened by sliding an edge loop added to the default cube, then pressing B.
  • Vertex slide error happened on the default cube, selecting a vertex, pressing G,G then B.
Noted some minor requests, otherwise LGTM, no extra iterations needed. ---- Linked ASAN report of crashes in vert and edge slide. - Edge slide crash happened by sliding an edge loop added to the default cube, then pressing B. - Vertex slide error happened on the default cube, selecting a vertex, pressing G,G then B.
First-time contributor

This is for me one of the greatest Blender features ever added to Blender since I first started using it some 13 years ago, and the end of my last great gripe with it.

Thank you to Germano and Cambell for seeing this through!

This is for me one of the greatest Blender features ever added to Blender since I first started using it some 13 years ago, and the end of my last great gripe with it. Thank you to Germano and Cambell for seeing this through!
Member

Me too, now I can finally recommend Blender to my friends majoring architecture. Big thanks to Germano :)

Me too, now I can finally recommend Blender to my friends majoring architecture. Big thanks to Germano :)
First-time contributor

Hi. I've got a question about the way basepoint snapping is calculated during snapping on edge.
Not sure which level this issue belong to, so I asked it here - https://devtalk.blender.org/t/snapping-precision-modeling-improvements/28435/20?u=1d_inc

Hi. I've got a question about the way basepoint snapping is calculated during snapping on edge. Not sure which level this issue belong to, so I asked it here - https://devtalk.blender.org/t/snapping-precision-modeling-improvements/28435/20?u=1d_inc
Author
Member

Thanks for the feedback :)
Before implementing this solution, it might be good to see how the change to code #108467 will proceed.

Thanks for the feedback :) Before implementing this solution, it might be good to see how the change to code #108467 will proceed.
First-time contributor

This is for me one of the greatest Blender features ever added to Blender since I first started using it some 13 years ago, and the end of my last great gripe with it.

Thank you to Germano and Cambell for seeing this through!

In my experience it is the solution to the most heavy Blender basic functionality design incompleitance since 1994.

> This is for me one of the greatest Blender features ever added to Blender since I first started using it some 13 years ago, and the end of my last great gripe with it. > > Thank you to Germano and Cambell for seeing this through! In my experience it is the solution to the most heavy Blender basic functionality design incompleitance since 1994.
Germano Cavalcante force-pushed snap_base from 09776c904f to 38e7c245c9 2023-06-02 15:31:48 +02:00 Compare
Author
Member

Updated based on the review.
Fixed bugs and now we have 2 new modal keyitems instead of 1. They are:

  • "EDIT_SNAP_SOURCE_ON" and
  • "EDIT_SNAP_SOURCE_OFF"

The advantage of having both is that users, if they prefer, can set the confirmation ("EDIT_SNAP_SOURCE_OFF") to release the B key instead of pressing it.

I plan to merge into master later today if everything is working fine.

@blender-bot package

Updated based on the review. Fixed bugs and now we have 2 new modal keyitems instead of 1. They are: - "EDIT_SNAP_SOURCE_ON" and - "EDIT_SNAP_SOURCE_OFF" The advantage of having both is that users, if they prefer, can set the confirmation ("EDIT_SNAP_SOURCE_OFF") to release the `B` key instead of pressing it. I plan to merge into master later today if everything is working fine. @blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR104443) when ready.
Germano Cavalcante force-pushed snap_base from 38e7c245c9 to 8bf06f6419 2023-06-03 04:17:25 +02:00 Compare
Germano Cavalcante merged commit 3010f1233b into main 2023-06-03 04:18:55 +02:00
Germano Cavalcante deleted branch snap_base 2023-06-03 04:18:56 +02:00
First-time contributor

Downloaded the build (the updated one is windows only), discovered two options in keymap prefs (regular and off).
I found (off) snap option in modals keymap and set it to "release" to test.

It is a bit faster (saves a mouseclick while utilizing a finger which is located at the B key during operation anyway), but in gizmo mode it assumes 2 keys (B and LMB) held simultaneously during aiming.
In my opinion any kind of pressholdings are better be avoided and minimized by default if is possible (especially double pressholdings, because the motorics decision which one should be released first require training to be easily performed on a realworld tasks), but it is nice to have a technical possibility to set it up like that.

Downloaded the build (the updated one is windows only), discovered two options in keymap prefs (regular and off). I found (off) snap option in modals keymap and set it to "release" to test. It is a bit faster (saves a mouseclick while utilizing a finger which is located at the B key during operation anyway), but in gizmo mode it assumes 2 keys (B and LMB) held simultaneously during aiming. In my opinion any kind of pressholdings are better be avoided and minimized by default if is possible (especially double pressholdings, because the motorics decision which one should be released first require training to be easily performed on a realworld tasks), but it is nice to have a technical possibility to set it up like that.
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
8 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#104443
No description provided.