0 votes

With a bit of trial and error, I managed to make a custom AnimationNode script. However, even if I've implemented the has_filter() method to return true, I don't see the "Edit Filter" in the AnimationTree. I even tried returning the string "true" because the doc says this method should return a String.

I feel like has_filter method is never called, I put a print in it and never saw anything in the console. Am I missing a step? I can't find any exemple of custom nodes so I have nothing to compare to.

tool
extends AnimationNode

class_name AnimationNodeStartStop

export(float, 0, 10, 0.1)var fade_in = 0.1
export(float, 0, 10, 0.1)var fade_out = 0.1

func _init():
    add_input("in")
    add_input("shot")
    filter_enabled = true

func get_caption():
    return "StartStopOneShot"

func get_parameter_list():
    var result = [
        {"name": "start", "type": TYPE_BOOL},
        {"name": "stop", "type": TYPE_BOOL},
        {"name": "playing", "type": TYPE_BOOL, "usage": 0},
        {"name": "time", "type": TYPE_REAL, "usage": 0},
        {"name": "remaining", "type": TYPE_REAL, "usage": 0}
    ]

    return result

func get_parameter_default_value(name):
    match name:
        "start": return false
        "stop": return false
        "playing": return false
        "time": return 0.0
        "remaining": return 0.0

func has_filter():
    return true

func process(time, seek):
    pass
Godot version 3.5
in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.