Skip to content

Commit

Permalink
Merge branch 'main' into feature/spawn_robots
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Della Vedova <[email protected]>
  • Loading branch information
luca-della-vedova committed May 17, 2023
2 parents ae905c2 + f796e44 commit d7a4832
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions rmf_site_editor/src/site/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::{
};
use bevy::{asset::LoadState, gltf::Gltf, prelude::*};
use bevy_mod_outline::OutlineMeshExt;
use rmf_site_format::{AssetSource, ModelMarker, Pose, Scale, UrdfRoot};
use rmf_site_format::{AssetSource, ModelMarker, Pending, Pose, Scale, UrdfRoot};
use smallvec::SmallVec;

#[derive(Component, Debug, Clone)]
Expand Down Expand Up @@ -311,7 +311,7 @@ pub fn update_model_scales(

pub fn make_models_selectable(
mut commands: Commands,
new_scene_roots: Query<Entity, Added<ModelSceneRoot>>,
new_scene_roots: Query<Entity, (Added<ModelSceneRoot>, Without<Pending>)>,
parents: Query<&Parent>,
scene_roots: Query<&Selectable, With<ModelMarker>>,
all_children: Query<&Children>,
Expand Down
16 changes: 10 additions & 6 deletions rmf_site_editor/src/site_asset_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,16 @@ impl SiteAssetIo {
)));
}
};
let binding = name.clone();
let filename = binding.splitn(3, "/").collect::<Vec<_>>()[2];
/*
let binding = PathBuf::from(model_name);
let model_name = binding.file_stem().unwrap().to_str().unwrap();
*/
// TODO(luca) migrate to split.remainder once
// https://github.com/rust-lang/rust/issues/77998 is stabilized
let binding = tokens.fold(String::new(), |prefix, path| prefix + "/" + path);
if binding.len() < 2 {
return Err(AssetIoError::Io(io::Error::new(
io::ErrorKind::Other,
format!("File name not found for: {name}"),
)));
}
let filename = binding.split_at(1).1;
let uri = format!(
"{0}/{1}/models/{2}/tip/files/{3}",
FUEL_BASE_URI, org_name, model_name, filename
Expand Down

0 comments on commit d7a4832

Please sign in to comment.