Page MenuHome

Transform cursor (patch included)
Confirmed, NormalPublicDESIGN


Recently LMB-Drag was made to move the cursor (edit, this has since been reverted).

However this just moves the cursor under the mouse,

it _could_ be useful to use transform here, it allows.

  • Drag, XKey to lock to an axis
  • ... Shift+Y to constrain to a plane.
  • ... Hold Ctrl to snap (snap to verts for example is handy)
  • ... Shift for more precise placement...

... most other transform keys.

One reservation I have about this, is that you probably would often want to be able to snap to vertices and edges, and not have to depend on the current snap options in the 3d view header.

So we could override the snap options that transform uses.... but this seems a bit crappy too, since you may want to snap to faces in some cases, or even snap to grid.

As an alternative, we could just not bother attempting to integrate this with transform, and add snapping to the current modal operator (similar to how we have with the Ruler operator, which shares low level code with transform snapping)
But in that case we miss the axis constraints which seem like they would be nice to support.

Here is a test patch to show how it works: P87
Note, it crashes if you try to scale and its hard coded to LMB for cursor place, so its mostly a proof of concept.

Event Timeline

I don't quite understand your reservation about "snap to vertices and edges"? Seems to me it makes the most sense to use the same Transform Snap as the other tools, allowing for a consistent workflow and faster learning. Rather than using a custom set of snap options.

@Jonathan Williamson (carter2422)

My reservations are that current transform snap is quite configurable, but you may not want to have to consider these settings when using cursor snap which I see as a convenience feature you won't want to be configuring.

For example, the 3D ruler snaps to verts, edges, faces (in that order), for general use I think this is nice functionality.

When you snap the 3D cursor, you probably want to snap to geometry (rather then volume or grid for example), So we could just make this default behavior. - Especially since snap to verts *isn't* enabled by default.

Note, that overriding the user selection could be done with/without using transform code.

I'd say snapping on mid of volume and grid might be equally desirable.

I know for me personally I use Cursor to Grid and Cursor to Selection all the time.

The benefit I see to using the Transform snapping options for the Cursor is a few things:

  1. Consistency with transform tools, greatly lessening the learning curve
  2. More control over snapping behavior
  3. More overlap of tools, ensuring a more consistent experience and perhaps reducing code bloat for similar features (but maybe not, as you know this isn't my area of expertise :) )

Can see pros and cons for both. (warning, it may sound like I'm over-thinking this :), but think its good to make good decision for such an often used feature).

I'm wary of supporting each transform option just because you _might_ want to use them. Its a bit of a tradeoff.
I see the cursor snapping as something that has an advantage of working predictably (without having to consider toolsettings) and if you want some different behavior there is always the snap menu (for snap to grid for eg).

As mentioned before, the 3D ruler tool just snaps to verts/edges/faces, and you dont have to mess about with transform options. You hold Ctrl and you know what to expect, IMHO there is some advantage in doing the same for cursor movement.
On paper it looks better to support more options, but in this case IMHO the trade-off is you loose nice fast workflow.
If you open someones file, you cant quickly place the cursor... without first changing their snap settings (in many cases).

@Jonathan Williamson (carter2422) - yep, its consistent, the question is more weather its really a good to connect these settings, when we could pick a fixed behavior which does what you want (most of the time).

I wouldn't worry too much about code-bloat, 3d-ruler and transform share snapping code anyway.

Main drawbacks with using transform IMHO are:

  • snap (magnet icon) may be set on, so enabling snap by default also will apply to cursor. (could be pro or con depending on POV)
  • Vertex snap isnt default
  • You have to manually switch between vert/edge/face (which 3d-ruler style snapping can support all at once).
  • Transform as an advanced mode, configuring all options while LMB is held, is quite awkward (typing in values for eg).
  • Its a bit of a hack, for example, we have to disable switching into other transform modes (scale/rotate) and also have to make a special case with event checking so releasing the mouse button exits.

Just a followup comment on this, since we were discussing it in IRC, this patch is something we should consider alongside the Widgets work in the 2.8x project, assuming we're able to tackle an overall improvement to Blender's snapping and transform system.