From cfdb233029491d0fbd1f4e96a3989457f5158731 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Wed, 28 Aug 2024 18:00:56 +0200 Subject: [PATCH] Fix secondary plot components ignoring blueprint defaults (#7302) Title. `check_blueprint_overrides` before: ![image](https://github.com/user-attachments/assets/3d2bb47e-e8d4-48eb-8342-8a10ea89b305) `check_blueprint_overrides` after: ![image](https://github.com/user-attachments/assets/16b697a5-7ecc-4b70-bc80-793c72772d01) --- .../src/line_visualizer_system.rs | 11 ++++++----- .../src/point_visualizer_system.rs | 19 +++++++++++-------- .../check_latest_at_partial_updates.py | 7 ++++--- .../check_range_partial_updates.py | 7 ++++--- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/crates/viewer/re_space_view_time_series/src/line_visualizer_system.rs b/crates/viewer/re_space_view_time_series/src/line_visualizer_system.rs index c5f574979181..9097b80e274e 100644 --- a/crates/viewer/re_space_view_time_series/src/line_visualizer_system.rs +++ b/crates/viewer/re_space_view_time_series/src/line_visualizer_system.rs @@ -297,9 +297,10 @@ impl SeriesLineSystem { }) } - if let Some(all_color_chunks) = results.get_required_chunks(&Color::name()) { + { + let all_color_chunks = results.get_optional_chunks(&Color::name()); if all_color_chunks.len() == 1 && all_color_chunks[0].is_static() { - re_tracing::profile_scope!("override fast path"); + re_tracing::profile_scope!("override/default fast path"); let color = all_color_chunks[0] .iter_primitive::(&Color::name()) @@ -337,12 +338,12 @@ impl SeriesLineSystem { debug_assert_eq!(StrokeWidth::arrow_datatype(), ArrowDatatype::Float32); - if let Some(all_stroke_width_chunks) = - results.get_required_chunks(&StrokeWidth::name()) { + let all_stroke_width_chunks = results.get_optional_chunks(&StrokeWidth::name()); + if all_stroke_width_chunks.len() == 1 && all_stroke_width_chunks[0].is_static() { - re_tracing::profile_scope!("override fast path"); + re_tracing::profile_scope!("override/default fast path"); let stroke_width = all_stroke_width_chunks[0] .iter_primitive::(&StrokeWidth::name()) diff --git a/crates/viewer/re_space_view_time_series/src/point_visualizer_system.rs b/crates/viewer/re_space_view_time_series/src/point_visualizer_system.rs index da9f26e3bb3a..e67d42f9f50b 100644 --- a/crates/viewer/re_space_view_time_series/src/point_visualizer_system.rs +++ b/crates/viewer/re_space_view_time_series/src/point_visualizer_system.rs @@ -313,9 +313,11 @@ impl SeriesPointSystem { }) } - if let Some(all_color_chunks) = results.get_required_chunks(&Color::name()) { + { + let all_color_chunks = results.get_optional_chunks(&Color::name()); + if all_color_chunks.len() == 1 && all_color_chunks[0].is_static() { - re_tracing::profile_scope!("override fast path"); + re_tracing::profile_scope!("override/default fast path"); let color = all_color_chunks[0] .iter_primitive::(&Color::name()) @@ -353,11 +355,11 @@ impl SeriesPointSystem { debug_assert_eq!(MarkerSize::arrow_datatype(), ArrowDatatype::Float32); - if let Some(all_marker_size_chunks) = - results.get_required_chunks(&MarkerSize::name()) { + let all_marker_size_chunks = results.get_optional_chunks(&MarkerSize::name()); + if all_marker_size_chunks.len() == 1 && all_marker_size_chunks[0].is_static() { - re_tracing::profile_scope!("override fast path"); + re_tracing::profile_scope!("override/default fast path"); let marker_size = all_marker_size_chunks[0] .iter_primitive::(&MarkerSize::name()) @@ -401,13 +403,14 @@ impl SeriesPointSystem { { re_tracing::profile_scope!("fill marker shapes"); - if let Some(all_marker_shapes_chunks) = - results.get_required_chunks(&MarkerShape::name()) { + let all_marker_shapes_chunks = + results.get_optional_chunks(&MarkerShape::name()); + if all_marker_shapes_chunks.len() == 1 && all_marker_shapes_chunks[0].is_static() { - re_tracing::profile_scope!("override fast path"); + re_tracing::profile_scope!("override/default fast path"); let marker_shape = all_marker_shapes_chunks[0] .iter_component::() diff --git a/tests/python/release_checklist/check_latest_at_partial_updates.py b/tests/python/release_checklist/check_latest_at_partial_updates.py index afae940ed383..d06b9e1f3f42 100644 --- a/tests/python/release_checklist/check_latest_at_partial_updates.py +++ b/tests/python/release_checklist/check_latest_at_partial_updates.py @@ -65,9 +65,10 @@ def blueprint() -> rrb.BlueprintLike: ), ] ), - rrb.BlueprintPanel(state="collapsed"), - rrb.TimePanel(state="collapsed"), - rrb.SelectionPanel(state="collapsed"), + # NOTE: It looks nice but it's very annoying when going through several checklists. + # rrb.BlueprintPanel(state="collapsed"), + # rrb.TimePanel(state="collapsed"), + # rrb.SelectionPanel(state="collapsed"), ) diff --git a/tests/python/release_checklist/check_range_partial_updates.py b/tests/python/release_checklist/check_range_partial_updates.py index b335a9e79bcd..f2efe1c89185 100644 --- a/tests/python/release_checklist/check_range_partial_updates.py +++ b/tests/python/release_checklist/check_range_partial_updates.py @@ -98,9 +98,10 @@ def blueprint() -> rrb.BlueprintLike: ], grid_columns=3, ), - rrb.BlueprintPanel(state="collapsed"), - rrb.TimePanel(state="collapsed"), - rrb.SelectionPanel(state="collapsed"), + # NOTE: It looks nice but it's very annoying when going through several checklists. + # rrb.BlueprintPanel(state="collapsed"), + # rrb.TimePanel(state="collapsed"), + # rrb.SelectionPanel(state="collapsed"), )