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

New debug option to show the blueprint in the streams view #4189

Merged
merged 2 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion crates/re_data_ui/src/component_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ impl DataUi for ComponentPath {
component_name,
} = self;

let store = ctx.store_db.store();
let store = if ctx.app_options.show_blueprint_in_timeline
&& ctx
.store_context
.blueprint
.entity_db()
.is_logged_entity(entity_path)
{
ctx.store_context.blueprint.store()
} else {
ctx.store_db.store()
};

if let Some(archetype_name) = component_name.indicator_component_archetype() {
ui.label(format!(
Expand Down
12 changes: 11 additions & 1 deletion crates/re_data_ui/src/instance_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@ impl DataUi for InstancePath {
instance_key,
} = self;

let store = ctx.store_db.store();
let store = if ctx.app_options.show_blueprint_in_timeline
&& ctx
.store_context
.blueprint
.entity_db()
.is_logged_entity(entity_path)
{
ctx.store_context.blueprint.store()
} else {
ctx.store_db.store()
};

let Some(components) = store.all_components(&query.timeline, entity_path) else {
if ctx.store_db.entity_db().is_known_entity(entity_path) {
Expand Down
17 changes: 16 additions & 1 deletion crates/re_time_panel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ impl TimePanel {
None,
&ctx.store_db.entity_db().tree,
ui,
"/",
);
} else {
self.show_children(
Expand All @@ -403,6 +404,18 @@ impl TimePanel {
ui,
);
}
if ctx.app_options.show_blueprint_in_timeline {
self.show_tree(
ctx,
time_area_response,
time_area_painter,
tree_max_y,
None,
&ctx.store_context.blueprint.entity_db().tree,
ui,
"/ (blueprint)",
);
}
});
}

Expand All @@ -416,6 +429,7 @@ impl TimePanel {
last_path_part: Option<&EntityPathPart>,
tree: &EntityTree,
ui: &mut egui::Ui,
show_root_as: &str,
) {
let tree_has_data_in_current_timeline = ctx.tree_has_data_in_current_timeline(tree);

Expand All @@ -427,7 +441,7 @@ impl TimePanel {
format!("{last_path_part}/") // show we have children with a /
}
} else {
"/".to_owned()
show_root_as.to_owned()
};

let collapsing_header_id = ui.make_persistent_id(&tree.path);
Expand Down Expand Up @@ -531,6 +545,7 @@ impl TimePanel {
Some(last_component),
child,
ui,
"/",
);
}

Expand Down
6 changes: 6 additions & 0 deletions crates/re_viewer/src/ui/rerun_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,12 @@ impl App {
)
.on_hover_text("Show a debug overlay that renders the picking layer information using the `debug_overlay.wgsl` shader.");

self.re_ui.checkbox(ui,
&mut self.state.app_options.show_blueprint_in_timeline,
"Show Blueprint in the Time Panel",
)
.on_hover_text("Show the Blueprint data in the Time Panel tree view. This is useful for debugging the internal blueprint state.");

ui.menu_button("Crash", |ui| {
#[allow(clippy::manual_assert)]
if ui.button("panic!").clicked() {
Expand Down
5 changes: 5 additions & 0 deletions crates/re_viewer_context/src/app_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ pub struct AppOptions {
/// Displays an overlay for debugging picking.
pub show_picking_debug_overlay: bool,

/// Includes the blueprint in the timeline view.
pub show_blueprint_in_timeline: bool,

/// What time zone to display timestamps in.
pub time_zone_for_timestamps: TimeZone,
}
Expand All @@ -46,6 +49,8 @@ impl Default for AppOptions {

show_picking_debug_overlay: false,

show_blueprint_in_timeline: false,

time_zone_for_timestamps: TimeZone::Utc,
}
}
Expand Down