Merge pull request #64560 from olibombardier/has-filter-virtual

Fix has_filter of AnimationNode not being called in scripts
This commit is contained in:
Yuri Sizov 2022-08-22 16:07:46 +03:00 committed by GitHub
commit cdced052f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -107,7 +107,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

@ -357,6 +357,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;
}
@ -427,7 +430,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"));