-
Notifications
You must be signed in to change notification settings - Fork 366
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
Refactor viewport blueprint logic #8056
Comments
GUI automated testing would require cc @lucasmerlin |
PlanThe Replace Remove Chronology over a frame
Three levels of auto
Sources of confusionThe existence of space-views is separate from their existence in the tree |
Checklist for ongoing work
|
The viewport blueprint code is a mess, and modifying it is extremely error prone
Cannot find root container
warning on startup #8051No one is to blame - this has evolved over time - but we need to untangle this.
How and why is it messy?
I don't fully understand all of it.
Triplicate state
egui_tiles::Tree
(created at the start of each frame)struct ViewportBlueprint
(created at the start of each frame)Existence of blueprint entities is significant
We use
SystemCommand::DropEntity
to permanently remove space-view entities from the blueprint store. This means we cannot undo the removal of a space-view.Our loader should instead start with the
RootContainer
and recuse down, and ignore all entities that aren't reachable.When I tried to implement this however, I created more trouble for myself.
Views
We view the
ViewportBlueprint
it in two places:BlueprintTree
panel (left)If we only mutated the state at the end/beginning of the frame, this wouldn't be a problem,
but I suspect we actually mutate state between calling these two views, which of course causes problems.
Auto-layout
We want to automatically create space-views if there is no explicit blueprint, leading to complicated state like
auto_layout
andauto_space_views
:rerun/crates/viewer/re_viewport_blueprint/src/viewport_blueprint.rs
Lines 44 to 54 in 31a166f
Delayed action
Almost all edits of the state is delayed, often in multiple steps.
This is because of (at least) two reasons (as far as I can tell)
egui_tiles::Tree
while we're iterating over itDelays happen in
TreeAction
TreeAction
can however lead to another frame-delay:rerun/crates/viewer/re_viewport/src/viewport.rs
Lines 415 to 421 in 31a166f
The text was updated successfully, but these errors were encountered: