godotengine / godotengine/godot

Parenting animated nodes to a _vehicle node causes glTF animation import to fail

Open
#96,485 0 comments 2 reactions 0 assignees View on GitHub
bug topic:3d topic:import
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproduceable in v4.3.stable.steam [77dcf97d8] and v4.2.2.stable.official [15073afe3]

### System information

Windows 11 Home, Mobile, RTX 3080 Ti, 11th Gen Intel i7-11700k

### Issue description

When creating 3D vehicles using 3D modeling and animation software, it is possible to create vehicles using the `_vehicle` and `_wheel` node suffixes to designate specific nodes as either vehicles or wheels, respectively. However, if an animated node of any kind is parented to or a descendant of a `_vehicle` tagged node, it causes the animation to fail to import properly. In the case of 4.2.2, the animations do not import at all. In 4.3, animations will import, but are obviously using the incorrect node paths during the import. This causes Output to be spammed with errors and warnings similar to the following:

```
<--- Error Sample --->
Node not found: "Node/root/body_vehicle/left_tread_12" (relative to "blockbench_export").
Node not found: "Node/root/body_vehicle/left_tread_12" (relative to "blockbench_export").
Node not found: "Node/root/body_vehicle/left_tread_22" (relative to "blockbench_export").
Node not found: "Node/root/body_vehicle/left_tread_22" (relative to "blockbench_export").
Node not found: "Node/root/body_vehicle/left_tread_32" (relative to "blockbench_export").
Node not found: "Node/root/body_vehicle/left_tread_32" (relative to "blockbench_export").

<--- Warning Sample --->
scene/animation/animation_mixer.cpp:668 - AnimationMixer (at: tiny-tank.gltf): 'forward', couldn't resolve track: 'Node/root/body_vehicle/left_tread_12'. This warning can be disabled in Project Settings. (User)
scene/animation/animation_mixer.cpp:668 - AnimationMixer (at: tiny-tank.gltf): 'forward', couldn't resolve track: 'Node/root/body_vehicle/left_tread_12'. This warning can be disabled in Project Settings. (User)
scene/animation/animation_mixer.cpp:668 - AnimationMixer (at: tiny-tank.gltf): 'forward', couldn't resolve track: 'Node/root/body_vehicle/left_tread_22'. This warning can be disabled in Project Settings. (User)
scene/animation/animation_mixer.cpp:668 - AnimationMixer (at: tiny-tank.gltf): 'forward', couldn't resolve track: 'Node/root/body_vehicle/left_tread_22'. This warning can be disabled in Project Settings. (User)
scene/animation/animation_mixer.cpp:668 - AnimationMixer (at: tiny-tank.gltf): 'forward', couldn't resolve track: 'Node/root/body_vehicle/left_tread_32'. This warning can be disabled in Project Settings. (User)
scene/animation/animation_mixer.cpp:668 - AnimationMixer (at: tiny-tank.gltf): 'forward', couldn't resolve track: 'Node/root/body_vehicle/left_tread_32'. This warning can be disabled in Project Settings. (User)
```
![image](https://github.com/user-attachments/assets/90e4882d-5cd5-426f-9c11-d58c157efb39)

It appears that the importer, when trying to import animations, is unaware that the `_vehicle` node name has changed from `*_vehicle` to `*` and is trying to associate the incoming animations with a node path that does not exist in the model anymore.

In this case, I would expect Godot would be aware that the `_vehicle` node has been renamed from (in my case) `body_vehicle` to `body` and to properly associate the animated nodes to their proper parent `body` instead of `body_vehicle`.

### Steps to reproduce

1. Create a 3D vehicle model in the animation software of your choice. I used blockbench to create the model used in the MRP.
2. Tag the vehicle body by appending the `_vehicle` suffix to the node name.
3. Tag the vehicle wheels by appending the `_wheel` suffix to the corresponding node names.
4. Animate an element parented to the vehicle body (or to one of its descendants).
5. Export the model with animations to the glTF format.
6. Import the model into Godot engine.
7. Observe console errors and warnings as described in issue description. Observe that animations are missing (4.2.2) or broken (4.3.x).

### Minimal reproduction project (MRP)

[vehicle_import_test.zip](https://github.com/user-attachments/files/16839968/vehicle_import_test.zip)

Contributor guide

Open the contributing guide

Research direction

Start with the attached vehicle_import_test.zip and reproduce the failure by importing its animated glTF model in Godot 4.2.2 or 4.3. Trace the glTF animation import path for nodes renamed from *_vehicle to *; done means descendant animation tracks resolve to the renamed nodes without missing-track errors or warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.