Transform cursor (patch included) #40952

Open
opened 2014-07-04 23:19:43 +02:00 by Campbell Barton · 12 comments

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.

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](https://archive.blender.org/developer/P87.txt) Note, it crashes if you try to scale and its hard coded to LMB for cursor place, so its mostly a proof of concept.
Author
Owner

Changed status to: 'Open'

Changed status to: 'Open'
Author
Owner
Added subscribers: @ideasman42, @Psy-Fi, @pablovazquez, @JonathanWilliamson

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.

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.
Author
Owner

@JonathanWilliamson

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.

@JonathanWilliamson 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'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 :) )
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 :) )
Author
Owner

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).

@JonathanWilliamson - 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.
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). @JonathanWilliamson - 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.

Added subscriber: @michaelknubben

Added subscriber: @michaelknubben

Added subscriber: @Lapineige

Added subscriber: @Lapineige

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.

Just a followup comment on this, since we were discussing it in IRC, this patch is something we should consider alongside the [Widgets work ](https://code.blender.org/2015/09/the-custom-manipulator-project-widget-project/) in the 2.8x project, assuming we're able to tackle an overall improvement to Blender's snapping and transform system.

Added subscriber: @DuarteRamos

Added subscriber: @DuarteRamos
Member

Added subscribers: @Blendify, @JulianEisel

Added subscribers: @Blendify, @JulianEisel
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:26:33 +01:00
Sign in to join this conversation.
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
7 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#40952
No description provided.