Fix has_filter of AnimationNode not being called in scripts

This commit is contained in:
Olivier Bombardier 2022-08-18 01:33:15 -04:00 committed by Relintai
parent 3a99f0afa1
commit 3c72fdfb0d
2 changed files with 5 additions and 2 deletions

View File

@ -104,7 +104,7 @@
</description>
</method>
<method name="has_filter" qualifiers="virtual">
<return type="String" />
<return type="bool" />
<description>
When inheriting from [AnimationRootNode], implement this virtual method to return whether the blend tree editor should display filter editing on this node.
</description>

View File

@ -367,6 +367,9 @@ bool AnimationNode::is_path_filtered(const NodePath &p_path) const {
}
bool AnimationNode::has_filter() const {
if (get_script_instance()) {
return get_script_instance()->call("has_filter");
}
return false;
}
@ -437,7 +440,7 @@ void AnimationNode::_bind_methods() {
}
BIND_VMETHOD(MethodInfo("process", PropertyInfo(Variant::REAL, "time"), PropertyInfo(Variant::BOOL, "seek")));
BIND_VMETHOD(MethodInfo(Variant::STRING, "get_caption"));
BIND_VMETHOD(MethodInfo(Variant::STRING, "has_filter"));
BIND_VMETHOD(MethodInfo(Variant::BOOL, "has_filter"));
ADD_SIGNAL(MethodInfo("removed_from_graph"));