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

3D->2D & 2D->3D selection visualizations stick now around on selection #4587

Merged
merged 9 commits into from
Dec 21, 2023

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Dec 19, 2023

What

Makes the 2D->3D and 3D->2D sticky upon selection!
Going the extra mile to make selection history be aware of this added a bit more stuff, but the code is better off overall I think :)

sticky.projections.mp4

Update! Now also works fine with multielection!
We now associate each item selection with an optional space context. Right now you can't space context without items, but this is not a structural limitation.
Toggle (ctrl+cmd select action) behavior has a few new special rules now: If you change the space view context on an already selected object its context is updated. If you add a new object, we add it to the list with the context.
Overall this paves also the way to displaying the context together with the selected item in a more sane way. Should be easier to reason with in general I believe.

Screen.Recording.2023-12-20.at.13.10.22.mov

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG

@Wumpf Wumpf added enhancement New feature or request 📺 re_viewer affects re_viewer itself include in changelog labels Dec 19, 2023
@teh-cmc
Copy link
Member

teh-cmc commented Dec 20, 2023

Nice! Multi-selections doesn't seem to work though (whether it's multiple rays in the 3D view, or multiple depth markers in the 2D view)? Is that expected?
image

@Wumpf
Copy link
Member Author

Wumpf commented Dec 20, 2023

Yeah that's expected so far. There's some curious asymmetries in the code about how this works out for hover & select. But I reckon it wouldn't be hard to set right 🤔:

  • a selection should be allowed to have several "space view contexts" and a hover only have one
  • adding entities to a selection shouldn't remove existing context objects and may add additional ones
  • history always stores a vec of contexts

@Wumpf
Copy link
Member Author

Wumpf commented Dec 20, 2023

Let's do it. It would be pretty neat for multi point in the 3d viewport

@Wumpf Wumpf marked this pull request as draft December 20, 2023 08:29
@Wumpf Wumpf force-pushed the andreas/sticky-hover-line branch from ecdadae to c196717 Compare December 20, 2023 11:34
@Wumpf Wumpf marked this pull request as ready for review December 20, 2023 12:13
@teh-cmc teh-cmc self-requested a review December 20, 2023 13:39
crates/re_viewer/src/ui/selection_history_ui.rs Outdated Show resolved Hide resolved
crates/re_viewer_context/src/selection_state.rs Outdated Show resolved Hide resolved
@Wumpf Wumpf merged commit 88f7bbb into main Dec 21, 2023
40 checks passed
@Wumpf Wumpf deleted the andreas/sticky-hover-line branch December 21, 2023 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request include in changelog 📺 re_viewer affects re_viewer itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3D->2D & 2D->3D visualizations (depth display & ray) should stick around on selection
2 participants