@@ -556,7 +556,7 @@ fn load_node(
556
556
if let Some ( light) = gltf_node. light ( ) {
557
557
match light. kind ( ) {
558
558
gltf:: khr_lights_punctual:: Kind :: Directional => {
559
- parent. spawn_bundle ( DirectionalLightBundle {
559
+ let mut entity = parent. spawn_bundle ( DirectionalLightBundle {
560
560
directional_light : DirectionalLight {
561
561
color : Color :: from ( light. color ( ) ) ,
562
562
// NOTE: KHR_punctual_lights defines the intensity units for directional
@@ -566,9 +566,12 @@ fn load_node(
566
566
} ,
567
567
..Default :: default ( )
568
568
} ) ;
569
+ if let Some ( name) = light. name ( ) {
570
+ entity. insert ( Name :: new ( name. to_string ( ) ) ) ;
571
+ }
569
572
}
570
573
gltf:: khr_lights_punctual:: Kind :: Point => {
571
- parent. spawn_bundle ( PointLightBundle {
574
+ let mut entity = parent. spawn_bundle ( PointLightBundle {
572
575
point_light : PointLight {
573
576
color : Color :: from ( light. color ( ) ) ,
574
577
// NOTE: KHR_punctual_lights defines the intensity units for point lights in
@@ -581,6 +584,9 @@ fn load_node(
581
584
} ,
582
585
..Default :: default ( )
583
586
} ) ;
587
+ if let Some ( name) = light. name ( ) {
588
+ entity. insert ( Name :: new ( name. to_string ( ) ) ) ;
589
+ }
584
590
}
585
591
gltf:: khr_lights_punctual:: Kind :: Spot {
586
592
inner_cone_angle : _inner_cone_angle,
0 commit comments