From 2a6dd3e2e00341c53f0cb71e0233f13185176a1f Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 19 Jul 2024 05:24:06 -0600 Subject: [PATCH] Make the `GltfNode::children` links actually point to children. (#14390) Due to a bug in `load_gltf`, the `GltfNode::children` links of each node actually point to the node itself, rather than to the node's children. This commit fixes that bug. Note that this didn't affect the scene hierarchy of the instantiated glTF, only the hierarchy as present in the `GltfNode` assets. This is likely why the bug was never noticed until now. --- crates/bevy_gltf/src/loader.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_gltf/src/loader.rs b/crates/bevy_gltf/src/loader.rs index eaf6425904..4306a48d27 100644 --- a/crates/bevy_gltf/src/loader.rs +++ b/crates/bevy_gltf/src/loader.rs @@ -604,7 +604,7 @@ async fn load_gltf<'a, 'b, 'c>( ( child.index(), load_context - .get_label_handle(format!("{}", GltfAssetLabel::Node(node.index()))), + .get_label_handle(format!("{}", GltfAssetLabel::Node(child.index()))), ) }) .collect::>(),