Skip to content

Commit

Permalink
New debug option to show the blueprint in the streams view
Browse files Browse the repository at this point in the history
  • Loading branch information
jleibs committed Nov 9, 2023
1 parent 1aa220a commit 516d9ac
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 3 deletions.
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.store_db.entity_db().is_logged_entity(entity_path)
&& 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.store_db.entity_db().is_logged_entity(entity_path)
&& 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 the blueprint in the timeline",
)
.on_hover_text("Show the blueprint data in the timeline tree view. This is useful for debugging the blueprint.");

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

0 comments on commit 516d9ac

Please sign in to comment.