Skip to content

Commit

Permalink
use Name on node when loading a gltf file (bevyengine#1183)
Browse files Browse the repository at this point in the history
* export Name in prelude
* use Name instead of Labels in gltf scenes
  • Loading branch information
mockersf authored Jan 1, 2021
1 parent c25b41a commit 228c3df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/bevy_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_gltf/src/loader.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 228c3df

Please sign in to comment.