Page MenuHome

New Feature Proposal: Mixed Snap in 3d View.
ClosedPublic

Authored by Germano Cavalcante (mano-wii) on May 19 2018, 1:41 PM.
Tokens
"Love" token, awarded by michaelknubben."Love" token, awarded by monio."Love" token, awarded by johnsyed."Love" token, awarded by Christopher_Anderssarian."Love" token, awarded by duarteframos.

Details

Summary

The idea of this patch is to allow more than one snap mode to be enabled. So different combinations are possible.

One thing that still needs to be thought of is a layout indicating which modes are enabled in the popover (currently it is only possible to view 1 of the modes through the popover icon.).

Diff Detail

Repository
rB Blender

Event Timeline

  • Updated to match the latest changes.

This is absolutely great, I've been following Germano's work on improving the snap system and it is most welcome improvement. This was probably one of my last remaining gripes with Blender.

I see you can already select multiple snapping modes from the popover menu. Will it also be possible to have several snap targets active at the same time, say like Closest and Active?

This could somewhat lessen the lack of ability to freely choosing a snap target before transform.

Thanks for all the great work @Germano Cavalcante (mano-wii), keep it up!

(...)
Will it also be possible to have several snap targets active at the same time, say like Closest and Active? (...)

Is that really desirable? Some targets are already somewhat confusing (like Closest, which takes the point from the bound box instead of the object).
Other confusing issues are:

  • Target: Median is the same as Target: Center + Pivot Point: Median Point
  • Target: Active is the same as Target: Center + Pivot Point: Active Element

  I think mixing them would make things more confusing. But it is an area that has a lot to improve on.

  • SCE_SELECT_[...] -> SCE_SNAP_MODE_[...].

Some targets are already somewhat confusing (like Closest, which takes the point from the bound box instead of the object).

I was under the impression that Closest took the closest vertex, my reasoning was that by combining both Closest and Active, maybe I misunderstood how those work.
Ideally the Closest option would just take as target the vertex closest to the cursor, much like Inkscape does, in the absence of actually discretely specifying a base point for transforms.

I suppose that would require far deeper changes out of scope for this task.

  • Fix restrictive assert.
  • Prioritize the snap point over incremental when using constraints.
Campbell Barton (campbellbarton) requested changes to this revision.May 21 2018, 4:55 PM

Generally LGTM.

release/scripts/startup/bl_ui/space_topbar.py
262–270

We should see if adding multiple icons could work here. (would note is as TODO)

source/blender/editors/space_view3d/view3d_manipulator_ruler.c
346–347

unused

source/blender/editors/space_view3d/view3d_ruler.c
787–788

unused

source/blender/editors/transform/transform_constraints.c
198

Remove and add when you have the comment. - There are many comment todo's

source/blender/editors/transform/transform_snap.c
404

Couldn't we keep this check? eg: if (project and not snapping to other elements) {...}

source/blender/makesrna/intern/rna_scene.c
2647–2648

Should rename to snap_elements, it's not compatible with old setting so no reason to keep old name which is misleading.

This revision now requires changes to proceed.May 21 2018, 4:55 PM

Noticed new scenes have no mode set.

Germano Cavalcante (mano-wii) marked 4 inline comments as done.
  • Rename rna property "snap_element" to "snap_elements".
  • Add description "TODO: Display multiple icons."
  • Prevent the applySnapping function from making unnecessary calls.
  • Fix new scene not initializing snap_mode.
  • Place the SCE_SNAP_MODE_GRID flag near the SCE_SNAP_MODE_INCREMENT.
  • Fix typo.
Germano Cavalcante (mano-wii) marked 2 inline comments as done.May 21 2018, 8:47 PM
This revision is now accepted and ready to land.May 22 2018, 1:36 PM

Nice improvement!
Since we can enable more than one snap mode per time, maybe we shoud replace the active snap popover icon with a more general text like "Snap Mode".
It would be more consistent to other popovers we already have (like Shading, Overlays,...) and also be more communicative to new users.

Since we can enable more than one snap mode per time, maybe we shoud replace the active snap popover icon with a more general text like "Snap Mode".

I agree that it's strange to see just one icon with more than one mode enabled, but I think users would rather check out the current active mode without opening the popover.

After these improvements snapping to bezier curve objects doesn't seem to be working as expected in 2.8.
There seems to be some sort of offset when spanning curves to other geometry. Snapping meshed to curves appears to work as expected though.

In 2.79In 2.8

The closest option searches for the closest point in the bound box.
You can check what is happening by enabling the Bounds view in the Viewport Display panel of the object,
The problem is more related to the new changes in depsgraph than in the patch.

I tried to fix this bug this way: rB24677cf77bbd. But this commit was reversed because of the use of mutexes.

@Sergey Sharybin (sergey) or @Bastien Montagne (mont29), is this a known problem?

You can check what is happening by enabling the Bounds view in the Viewport Display panel of the object,

Indeed, you are right, turning on bounds shows the issue clearly. It seems the bounding box for curves is being wrongly calculated, there always appears to be a large buffer around it.
After entering and exiting Edit Mode the bounding box is recalculated and briefly displays as expected, but as soon as you transform again, it reverts to the previous wrong solution.