use Name on node when loading a gltf file (#1183)

* export Name in prelude
* use Name instead of Labels in gltf scenes
This commit is contained in:
François 2021-01-01 22:30:18 +01:00 committed by GitHub
parent c25b41a038
commit 228c3df751
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -17,7 +17,7 @@ pub use task_pool_options::DefaultTaskPoolOptions;
pub use time::*;
pub mod prelude {
pub use crate::{DefaultTaskPoolOptions, EntityLabels, Labels, Time, Timer};
pub use crate::{DefaultTaskPoolOptions, EntityLabels, Labels, Name, Time, Timer};
}
use bevy_app::{prelude::*, startup_stage};

View file

@ -1,6 +1,6 @@
use anyhow::Result;
use bevy_asset::{AssetIoError, AssetLoader, AssetPath, Handle, LoadContext, LoadedAsset};
use bevy_core::Labels;
use bevy_core::Name;
use bevy_ecs::{bevy_utils::BoxedFuture, World, WorldBuilderSource};
use bevy_math::Mat4;
use bevy_pbr::prelude::{PbrBundle, StandardMaterial};
@ -318,7 +318,7 @@ fn load_node(
));
if let Some(name) = gltf_node.name() {
node.with(Labels::from(vec![name.to_string()]));
node.with(Name::new(name.to_string()));
}
// create camera node