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

Space view screenshotting in native viewer #8258

Merged
merged 16 commits into from
Dec 3, 2024
Merged

Conversation

emilk
Copy link
Member

@emilk emilk commented Nov 29, 2024

Related

What

Right-click the name of any space view to get the option to copy its contents as a screenshot, or save it to disk:

image

->

image

Details

The implementation simply takes a full-screen screenshot and crops the result.

The previous attempt (behind a feature-flag) only captured things that were rendered with re_renderer, i.e. did not include any egui elements, like labels. So it also only worked on spatial views. This PR work on all space views, and could also be extended to work on containers etc.

Limitations

Not yet implemented on web. See #8264

TODO

  • Point commit hash to egui master

@emilk emilk added enhancement New feature or request 📺 re_viewer affects re_viewer itself include in changelog labels Nov 29, 2024
Copy link

github-actions bot commented Nov 29, 2024

Web viewer built successfully. If applicable, you should also test it:

  • I have tested the web viewer
Result Commit Link
b935f0b https://rerun.io/viewer/pr/8258

Note: This comment is updated whenever you push a commit.

@emilk emilk marked this pull request as draft November 29, 2024 15:30
@nikolausWest
Copy link
Member

Screenshot 2024-11-29 at 16 48 49

I'd the screenshot option on this menu

@emilk emilk force-pushed the emilk/view-screenshots branch from 77188ca to 9ef9022 Compare December 2, 2024 16:18
@emilk emilk changed the title egui-based view screenshotting Space view screenshotting Dec 3, 2024
@emilk emilk changed the title Space view screenshotting Space view screenshotting in native viewer Dec 3, 2024
@emilk emilk marked this pull request as ready for review December 3, 2024 11:04
@Wumpf Wumpf self-requested a review December 3, 2024 11:11
@Wumpf
Copy link
Member

Wumpf commented Dec 3, 2024

right click on the tab unfortunately selects the view, meaning that one can't have selection highlights on the screenshot

Co-authored-by: Andreas Reich <[email protected]>
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

Looks all good and straight forward.

the only thing that I didn't quite get is what removes the SpaceViewRectPublisher again from the cache for a view that's hidden. But it works 🤷

@@ -249,12 +246,6 @@ impl SpatialSpaceView2D {

// ------------------------------------------------------------------------
Copy link
Member

Choose a reason for hiding this comment

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

for later consideration: it was actually nice to have a context menu inside the view.

@@ -35,58 +35,59 @@ mod viewer_context;
// TODO(andreas): Move to its own crate?
pub mod gpu_bridge;

pub use annotations::{
AnnotationMap, Annotations, ResolvedAnnotationInfo, ResolvedAnnotationInfos,
pub use self::{
Copy link
Member

Choose a reason for hiding this comment

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

your ide went off the rails here? Doesn't make sense to group things under pub use self::.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it makes sense - it makes it obvious that these are public exports of things in this crate, rather than e.g. re-exports from some other crate

@emilk
Copy link
Member Author

emilk commented Dec 3, 2024

the only thing that I didn't quite get is what removes the SpaceViewRectPublisher again from the cache for a view that's hidden. But it works 🤷

egui does is for us :)

@emilk emilk merged commit 16f0309 into main Dec 3, 2024
31 checks passed
@emilk emilk deleted the emilk/view-screenshots branch December 3, 2024 13: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.

Exporting visualization for publications and presentations
3 participants