godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.08k stars 21.18k forks source link

animation tree root node instance bug #89353

Open yythlj opened 8 months ago

yythlj commented 8 months ago

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 image image

yythlj commented 8 months ago

when use local to scene , the tree root is different instance. but the node in the animation tree still the same instance

yythlj commented 8 months ago

I fix the problem , need to check the "local to scene" of every node in the animation tree

Wierdox commented 8 months ago

UPDATE: I actually had issue #87766, I just didn't notice the error because I had the Animation tab open instead of Output tab. Will keep this post, just in case they are both related somehow.

[contents of post moved to relevant issue]

BatteryAcid commented 7 months ago

I also ran into this when trying to swap Blend2 Filters on the fly (programmatically).

In my multiplayer setup, where I have a player scene that I'm applying different Filters depending on what weapon they have equipped, it was synching one peer's filter changes, to them all.

Probably not a bug as it was more about being ignorant to the configuration.

Thank you @yythlj for sharing!