@@ -92,6 +92,9 @@ impl ViewportBlueprint {
92
92
past_viewer_recommendations : results. component_batch ( ) ,
93
93
} ;
94
94
95
+ let root_container: Option < ContainerId > = root_container. map ( |id| id. 0 . into ( ) ) ;
96
+ re_log:: trace_once!( "Loaded root_container: {root_container:?}" ) ;
97
+
95
98
let all_space_view_ids: Vec < SpaceViewId > = blueprint_db
96
99
. tree ( )
97
100
. children
@@ -143,19 +146,19 @@ impl ViewportBlueprint {
143
146
let tree = build_tree_from_space_views_and_containers (
144
147
space_views. values ( ) ,
145
148
containers. values ( ) ,
146
- root_container. clone ( ) ,
149
+ root_container,
147
150
) ;
148
151
152
+ re_log:: trace_once!( "Loaded tree: {tree:#?}" ) ;
153
+
149
154
let past_viewer_recommendations = past_viewer_recommendations
150
155
. unwrap_or_default ( )
151
156
. iter ( )
152
157
. cloned ( )
153
158
. collect ( ) ;
154
159
155
- let root_container_or_placeholder = root_container. clone ( ) . map_or_else (
156
- || ContainerId :: hashed_from_str ( "placeholder_root_container" ) ,
157
- |id| id. 0 . into ( ) ,
158
- ) ;
160
+ let root_container_or_placeholder = root_container
161
+ . unwrap_or_else ( || ContainerId :: hashed_from_str ( "placeholder_root_container" ) ) ;
159
162
160
163
Self {
161
164
space_views,
@@ -909,7 +912,7 @@ impl ViewportBlueprint {
909
912
fn build_tree_from_space_views_and_containers < ' a > (
910
913
space_views : impl Iterator < Item = & ' a SpaceViewBlueprint > ,
911
914
containers : impl Iterator < Item = & ' a ContainerBlueprint > ,
912
- root_container : Option < RootContainer > ,
915
+ root_container : Option < ContainerId > ,
913
916
) -> egui_tiles:: Tree < SpaceViewId > {
914
917
re_tracing:: profile_function!( ) ;
915
918
let mut tree = egui_tiles:: Tree :: empty ( "viewport_tree" ) ;
@@ -933,7 +936,6 @@ fn build_tree_from_space_views_and_containers<'a>(
933
936
// And finally, set the root
934
937
935
938
if let Some ( root_container) = root_container {
936
- let root_container = ContainerId :: from ( root_container. 0 ) ;
937
939
tree. root = Some ( blueprint_id_to_tile_id ( & root_container) ) ;
938
940
}
939
941
0 commit comments