godotengine / godotengine/godot

animation tree root node instance bug

Open
#89,353 4 comments 0 reactions 0 assignees View on GitHub
needs testing topic:animation topic:editor
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

4.2.stable

### System information

windows10 godot4.2.1

### Issue description

If you use an Animation Tree to edit animations and save it as an external scene (which is common in networked games), and then create an Animation Tree scene for each character scene to control their Animation Player, you may encounter a bug where the Animation Tree root node is the same instance. Even if the Animation Tree instances are not the same, anim_tree.get_tree_root() will return the same instance regardless of whether "Local to Scene" is enabled or not. This causes an issue where modifying the bone filters of a specific Animation Tree can inadvertently modify the bone filters of other instances.

In this scenario, when modifying the bone filters of one Animation Tree, if there are locally named bones that exist in other instances, it will unintentionally modify the bone filters of those Animation Trees as well.

### Steps to reproduce

animation_tree is different instance 。but anim_tree.get_tree_root() is same

### Minimal reproduction project (MRP)

![image](https://github.com/godotengine/godot/assets/33251075/523ef742-3157-4bec-9826-1c553bd5f655)
![image](https://github.com/godotengine/godot/assets/33251075/b8b32a49-0e0c-4502-b62a-b499ad450843)
![image](https://github.com/godotengine/godot/assets/33251075/25f59227-2916-4d11-ab56-831e39466b77)

Contributor guide

Open the contributing guide

Research direction

Start with the AnimationTree and AnimationNode.get_tree_root() behavior in the reported external-scene setup, comparing instances with and without Local to Scene enabled. Reproduce the bone-filter change across character instances; the fix is complete when each Animation Tree has an independent root and changing one instance no longer changes another.

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
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.