From cd6764611c2f65b9a6953a38168e014b0286d7f2 Mon Sep 17 00:00:00 2001 From: Olivier Bombardier Date: Thu, 18 Aug 2022 01:33:15 -0400 Subject: [PATCH] Fix has_filter of AnimationNode not being called in scripts (cherry picked from commit c988deb3b126b4e4d1ff61949f419fd31cea651d) --- doc/classes/AnimationNode.xml | 2 +- scene/animation/animation_tree.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml index d0c4dc0b9ca..96776325d5f 100644 --- a/doc/classes/AnimationNode.xml +++ b/doc/classes/AnimationNode.xml @@ -107,7 +107,7 @@ - + Returns [code]true[/code] whether you want the blend tree editor to display filter editing on this node. diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index d2f4cd37f24..f371824c029 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -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"));