diff --git a/rmf_site_editor/src/interaction/model_preview.rs b/rmf_site_editor/src/interaction/model_preview.rs index 56f45f0e..9b9d6eb7 100644 --- a/rmf_site_editor/src/interaction/model_preview.rs +++ b/rmf_site_editor/src/interaction/model_preview.rs @@ -32,15 +32,6 @@ pub struct ModelPreviewCamera { pub struct ModelPreviewPlugin; -// TODO(luca) implement this system to scale the view based on the model's Aabb -fn scale_preview_for_model_bounding_box( - aabbs: Query<&Aabb, Changed>, - parents: Query<&Parent>, - model_preview: Res, - camera_transforms: Query<&mut Transform, With>, -) { -} - impl FromWorld for ModelPreviewCamera { fn from_world(world: &mut World) -> Self { // camera @@ -94,7 +85,6 @@ impl FromWorld for ModelPreviewCamera { impl Plugin for ModelPreviewPlugin { fn build(&self, app: &mut App) { - app.init_resource::() - .add_system(scale_preview_for_model_bounding_box); + app.init_resource::(); } } diff --git a/rmf_site_editor/src/site/fuel_cache.rs b/rmf_site_editor/src/site/fuel_cache.rs index b0ac753c..e284ca0b 100644 --- a/rmf_site_editor/src/site/fuel_cache.rs +++ b/rmf_site_editor/src/site/fuel_cache.rs @@ -58,7 +58,7 @@ pub fn handle_update_fuel_cache_requests( channels: Res, ) { if events.iter().last().is_some() { - info!("Updating fuel cache"); + info!("Updating fuel cache, this might take a few minutes"); gallery_status.fetching_cache = true; let mut fuel_client = fuel_client.clone(); let sender = channels.sender.clone(); diff --git a/rmf_site_editor/src/widgets/new_model.rs b/rmf_site_editor/src/widgets/new_model.rs index 12d8392d..fbb50132 100644 --- a/rmf_site_editor/src/widgets/new_model.rs +++ b/rmf_site_editor/src/widgets/new_model.rs @@ -23,6 +23,7 @@ use bevy_egui::egui::{Button, ComboBox, RichText, ScrollArea, Ui, Window}; use gz_fuel::FuelModel; /// Filters applied to models in the fuel list +#[derive(Default)] pub struct ShowAssetFilters { pub owner: Option, pub recall_owner: Option, @@ -33,7 +34,7 @@ pub struct ShowAssetFilters { } /// Used to signals whether to show or hide the left side panel with the asset gallery -#[derive(Resource)] +#[derive(Resource, Default)] pub struct AssetGalleryStatus { pub show: bool, pub selected: Option, @@ -45,34 +46,6 @@ pub struct AssetGalleryStatus { pub show_api_window: bool, } -impl Default for ShowAssetFilters { - fn default() -> Self { - Self { - owner: Some("OpenRobotics".into()), - recall_owner: None, - tag: None, - recall_tag: None, - private: None, - recall_private: None, - } - } -} - -impl Default for AssetGalleryStatus { - fn default() -> Self { - Self { - show: true, - selected: None, - cached_owners: None, - cached_tags: None, - filters: Default::default(), - proposed_api_key: Default::default(), - fetching_cache: false, - show_api_window: false, - } - } -} - #[derive(SystemParam)] pub struct NewModelParams<'w, 's> { pub fuel_client: ResMut<'w, FuelClient>, @@ -202,7 +175,7 @@ impl<'a, 'w, 's> NewModel<'a, 'w, 's> { ui.add_space(10.0); - // TODO(luca) should we cache the models by owner result to avoid calling at every + // TODO(luca) should we cache the models by filters result to avoid calling at every // frame? let models = models .iter() @@ -299,7 +272,7 @@ impl<'a, 'w, 's> NewModel<'a, 'w, 's> { if ui.add(Button::new("Set API key")).clicked() { gallery_status.show_api_window = true; } - if gallery_status.fetching_cache == true { + if gallery_status.fetching_cache { ui.label("Updating model cache..."); } else { if ui.add(Button::new("Update model cache")).clicked() {