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:
parent
c25b41a038
commit
228c3df751
@ -17,7 +17,7 @@ pub use task_pool_options::DefaultTaskPoolOptions;
|
|||||||
pub use time::*;
|
pub use time::*;
|
||||||
|
|
||||||
pub mod prelude {
|
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};
|
use bevy_app::{prelude::*, startup_stage};
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use bevy_asset::{AssetIoError, AssetLoader, AssetPath, Handle, LoadContext, LoadedAsset};
|
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_ecs::{bevy_utils::BoxedFuture, World, WorldBuilderSource};
|
||||||
use bevy_math::Mat4;
|
use bevy_math::Mat4;
|
||||||
use bevy_pbr::prelude::{PbrBundle, StandardMaterial};
|
use bevy_pbr::prelude::{PbrBundle, StandardMaterial};
|
||||||
@ -318,7 +318,7 @@ fn load_node(
|
|||||||
));
|
));
|
||||||
|
|
||||||
if let Some(name) = gltf_node.name() {
|
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
|
// create camera node
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user