Godot version:
v3.1.beta.custom_build.be98a6e
OS/device including version:
OS: Ubuntu 18.04.1
Issue description:
Method calls in animation clips are not being triggered when the animation is played on an AnimationTree with an AnimationNodeBlendTree as a tree root.
Minimal reproduction project:
test.zip
@N8n5h did you find workaround for this bug?
@akien-mga why this bug was moved to 3.2 milestone? this is very important functionality
@wojtasss @N8n5h I found a workaround that's not very pretty, but basically, if you put another call func track in the function being called at OneShot, it works. Also the "idle" function which calls the animation_started() function in your example needs to be in a loop. The call func track in rotate doesn't have anything on it, but without it the idle call func track breaks. Don't ask me why, but here's a working example.
animation-tree-bug.zip
Actually problem lies with 3D transform type track and track order, if you remove both transform tracks (or the one from rotate animation) - function call works.
If there is only one animation run by AnimationTree which have 3d transform track preceded somewhere by function call (animation tracks over same node) - call won't work.
But if you run animation from AnimationPlayer then there is no problem - everything works.
Which means processing 3d transform track somehow breaks future function call.
@N8n5h @wojtasss @torresguilherme I have found the source (or at least root) of the problem, but am not sure how to fix it.
Problem is the following: function call is not working indeed because of 3d transformation track, but the reason for that is that both track types lack property name. Tracks caches are stored by paths along with track types (animation_tree.cpp/AnimationTree::_update_caches), but when you create 3d transform type track or function call over same node their default path name is the same - path to the node itself, so godot confuse them for one another, skipping "wrong" track because it's saved type is different from the one cached last.
To fix this 3d transform and function call track types should be given unique names, but I'm not sure which ones, because they aren't real node properties (I don't know where and how to do it, hope someone will pick this up).
As for workaround conflicting names can be set manually across all animations used in AnimationTree like this ".:func1" or ".:tran1" (where "." is target node and ":func1" made up property name):

@wojtasss Ok, I had time to look at this again and answering your question: I pretty much just gave up and manually timed animation ending in code, which is cumbersome but it works.
@Calamander It's pretty cool that you could find what causes the issue with the minimal project, but with a rig the workaround seems impossible: having to manually rename every track for every anim for every bone it's just impossible. So I hope this gets fixed soon.
I do believe i fixed it in #32509
Can someone else confirm it?
@IllusiveS your PR seems to fix it on my end. Great work! This was one of the most annoying Godot issues for me.
Has anyone found a workaround for this? I'm not able to detect when an animation ends without polling the current state every frame
I just tested this on 3.2 and it works with the test scene posted.
Both call method and audio stream tracks are working for me as well. This is great! :tada:
Great, closing as fixed then.
Most helpful comment
@N8n5h @wojtasss @torresguilherme I have found the source (or at least root) of the problem, but am not sure how to fix it.

Problem is the following: function call is not working indeed because of 3d transformation track, but the reason for that is that both track types lack property name. Tracks caches are stored by paths along with track types (animation_tree.cpp/AnimationTree::_update_caches), but when you create 3d transform type track or function call over same node their default path name is the same - path to the node itself, so godot confuse them for one another, skipping "wrong" track because it's saved type is different from the one cached last.
To fix this 3d transform and function call track types should be given unique names, but I'm not sure which ones, because they aren't real node properties (I don't know where and how to do it, hope someone will pick this up).
As for workaround conflicting names can be set manually across all animations used in AnimationTree like this ".:func1" or ".:tran1" (where "." is target node and ":func1" made up property name):