Page MenuHome

Viewport: Add rotation tracking option to Lock to Cursor
Needs RevisionPublic

Authored by Asher (ThatAsherGuy) on Sun, Nov 10, 10:06 PM.


Jeroen Bakker (jbakker)
Group Reviewers
EEVEE & Viewport

This adds an option to make the 3D viewport track to the Z axis of the 3D cursor when Lock to Cursor is enabled. It's a work-in-progress, as I need to iron out some wrinkles with quad-view and what angle the viewport is restored to when the option is disabled, but it's functional enough to show off. Here's a quick video:

And an update clip:

When this option is enabled, users can take advantage of transform orientations, axis constraints, numeric input, and incremental snapping when they rotate the viewport. While I used a keyboard shortcut in the video, I see this working fairly well with a 3D cursor gizmo as the primary point of interaction.

Diff Detail

rB Blender

Event Timeline

Improved quad-view handling when track to cursor is enabled.

Asher (ThatAsherGuy) edited the summary of this revision. (Show Details)

Changed enable/disable behavior, wrapping the setting in an operator in order to take advantage of view smoothing. The view doesn't snap back to the prior view when tracking is disabled now, and users can temporarily rotate away from the cursor while tracking is enabled. I slowed down the transition speed significantly for this clip:

I made quite a mess piecing these changes together; I'll winnow down the ugly bits, next.

Jeroen Bakker (jbakker) requested changes to this revision.Thu, Nov 14, 4:21 PM

What issues does it solve? In what use-cases would this tool be helpful?

This revision now requires changes to proceed.Thu, Nov 14, 4:21 PM

It's mostly for scenarios where the 3D cursor is being used as a work plane and the user wants to manipulate the viewport relative to that plane. This lets users set the viewport to precise angles using the transform modal (using incremental snapping, axis constraints, advanced numeric input, etc), the sidebar (tweaking the cursor rotation directly), and the Set Cursor operator (using geometry alignment, etc). Instead of hard-locking the view rotation, I've set it up to feel elastic - users can rotate the view temporarily using the normal methods, and the view smoothly rotates back to the tracked angle after the rotation modal ends.

This could also prove useful for VR workflows, once I hammer out the finer details of the rotational decomposition method I want to use for transitions to/from the rotation track. With the right axis order and relative rotation rates, we should be able to reduce the chances of people feeling motion sick and/or disoriented when working with funky view angles.