Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Follow Selection" in the 3D editor by using Center Selection twice #99499

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Nov 21, 2024

When pressing the Focus Selection shortcut twice, you will begin following the current selection. This also applies to selection changes.

The effect is undone by pressing the Focus Selection shortcut another time, using the Focus Origin shortcut, or by panning/using freelook on the 3D editor camera. (Orbiting or switching between perspective and orthogonal does not undo the effect.)

Some use cases include:

  • Previewing lighting on a dynamic object as it moves across the scene.
  • More generally, previewing something moving through a scene using an AnimationPlayer, which comes handy when paired with PathFollow3D.
  • Jumping quickly from an object to another, while keeping your hand free of having to press F constantly.

Testing project: test_follow_selection.zip

Preview

Following the selection will also follow other selected nodes, so you can iterate quickly on different nodes that may be spread far away from each other:

follow_selection_changing_node_selection.mp4

While following the selection, you can manipulate it as usual, e.g. with Blender-style manipulation shortcuts:

follow_selection_blender_shortcuts.mp4

This also pairs well with grid snapping and Blender-style manipulation by entering units on the keyboard:

follow_selection_grid_snapping.mp4

Lastly, it works with keyboard-based camera manipulation too:

follow_selection_keyboard_navigation.mp4

@ryevdokimov
Copy link
Contributor

The functionality isn't aborted when selecting the items from the drop down menu:

image

Copy link
Contributor

@ryevdokimov ryevdokimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented a similar but more minimal function at my fork. I like the indicator in the corner.

Besides the comment above, looks good.

2024-11-22.12-04-38.mp4

@Calinou Calinou force-pushed the 3d-editor-add-follow-selection branch from c9aa1f9 to 056b399 Compare November 22, 2024 18:59
When pressing the Focus Selection shortcut twice, you will begin following
the current selection. This also applies to selection changes.

The effect is undone by pressing the Focus Selection shortcut another
time, using the Focus Origin shortcut, or by panning/using freelook
on the 3D editor camera. (Orbiting or switching between perspective and
orthogonal does not undo the effect.)
@Calinou
Copy link
Member Author

Calinou commented Nov 22, 2024

The functionality isn't aborted when selecting the items from the drop down menu:

On second thought, I realized these items don't change your position, but only your rotation relative to the object (similar to orbiting or using the numpad 2/4/6/8 keyboard shortcuts). I've made them no longer exit following mode. (This allows you to reorient the camera during a drag operation, which can be handy...)

However, your comment made me realize that Focus Origin wasn't exiting follow mode if the menu option was used instead of the shortcut, so I fixed that.

@Calinou Calinou force-pushed the 3d-editor-add-follow-selection branch from 056b399 to 8d1c55a Compare November 22, 2024 19:05
Copy link
Contributor

@ryevdokimov ryevdokimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retested based off the comment above. Rational makes sense. Function aborts on focus origin, but not changing views.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Press "F" twice to make the editor camera follow the selected node
3 participants