Clarify usage of AnimationPlayer with AnimationTree and fill empty doc descriptions #39234
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updated class documentation for
AnimationTree
:Added missing descriptions for
root_motion_track
andget_root_motion_transform()
Clarified usage of
AnimationPlayer
when paired with anAnimationTree
. The behavior is described in more detail in Correctness of AnimationPlayer's methods is affected when paired with an AnimationTree godot-docs#3610. Essentially, when anAnimationPlayer
object is paired with anAnimationTree
, several properties and methods exposed by theAnimationPlayer
class will not work as expected. Some of these include:as well as their associated setters and getters, and a couple of other methods. This occurs because an
AnimationTree
uses itsAnimationPlayer* player
primarily for itsMap<StringName, AnimationData> animation_set
.AnimationTree::_process_graph()
callsAnimationTree::_update_caches()
to get theanimation_set
from theplayer
and populate itstrack_cache
, instead of callingAnimationPlayer::play()
directly. Hence, most of the properties of theAnimationPlayer
will not be updated.godot/scene/animation/animation_tree.cpp
Lines 526 to 537 in d2be503
As suggested by @Calinou in #34947, it would be good to mention this behavior in the
AnimationTree
's class documentation.This closes #38956, closes #34947 and closes godotengine/godot-docs#3610