2018-08-29 22:38:13 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* animation_blend_tree.h */
|
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
|
|
|
/* https://godotengine.org */
|
|
|
|
/*************************************************************************/
|
2021-01-01 20:13:46 +01:00
|
|
|
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
|
2018-08-29 22:38:13 +02:00
|
|
|
/* */
|
|
|
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
|
|
/* a copy of this software and associated documentation files (the */
|
|
|
|
/* "Software"), to deal in the Software without restriction, including */
|
|
|
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
|
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
|
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
|
|
/* the following conditions: */
|
|
|
|
/* */
|
|
|
|
/* The above copyright notice and this permission notice shall be */
|
|
|
|
/* included in all copies or substantial portions of the Software. */
|
|
|
|
/* */
|
|
|
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
|
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
|
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
|
|
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
|
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
|
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2018-06-19 03:10:48 +02:00
|
|
|
#ifndef ANIMATION_BLEND_TREE_H
|
|
|
|
#define ANIMATION_BLEND_TREE_H
|
|
|
|
|
2018-06-25 23:40:24 +02:00
|
|
|
#include "scene/animation/animation_tree.h"
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2018-06-21 20:45:44 +02:00
|
|
|
class AnimationNodeAnimation : public AnimationRootNode {
|
|
|
|
GDCLASS(AnimationNodeAnimation, AnimationRootNode);
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
StringName animation;
|
2021-02-07 22:29:31 +01:00
|
|
|
StringName time = "time";
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2021-02-07 22:29:31 +01:00
|
|
|
uint64_t last_version = 0;
|
|
|
|
bool skip = false;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2021-10-12 00:27:50 +02:00
|
|
|
public:
|
2021-10-15 15:25:00 +02:00
|
|
|
enum PlayMode {
|
|
|
|
PLAY_MODE_FORWARD,
|
|
|
|
PLAY_MODE_BACKWARD
|
|
|
|
};
|
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
void get_parameter_list(List<PropertyInfo> *r_list) const override;
|
2018-11-08 20:51:45 +01:00
|
|
|
|
2018-08-20 18:38:18 +02:00
|
|
|
static Vector<String> (*get_editable_animation_list)();
|
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual String get_caption() const override;
|
2021-05-21 08:42:37 +02:00
|
|
|
virtual double process(double p_time, bool p_seek) override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
void set_animation(const StringName &p_name);
|
|
|
|
StringName get_animation() const;
|
|
|
|
|
2021-10-15 15:25:00 +02:00
|
|
|
void set_play_mode(PlayMode p_play_mode);
|
|
|
|
PlayMode get_play_mode() const;
|
|
|
|
|
|
|
|
void set_backward(bool p_backward);
|
|
|
|
bool is_backward() const;
|
|
|
|
|
2018-06-19 03:10:48 +02:00
|
|
|
AnimationNodeAnimation();
|
2021-10-15 15:25:00 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void _validate_property(PropertyInfo &property) const override;
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
private:
|
|
|
|
PlayMode play_mode = PLAY_MODE_FORWARD;
|
|
|
|
bool backward = false;
|
2018-06-19 03:10:48 +02:00
|
|
|
};
|
|
|
|
|
2021-10-15 15:25:00 +02:00
|
|
|
VARIANT_ENUM_CAST(AnimationNodeAnimation::PlayMode)
|
|
|
|
|
2018-06-19 03:10:48 +02:00
|
|
|
class AnimationNodeOneShot : public AnimationNode {
|
|
|
|
GDCLASS(AnimationNodeOneShot, AnimationNode);
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum MixMode {
|
|
|
|
MIX_MODE_BLEND,
|
|
|
|
MIX_MODE_ADD
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
2021-02-07 22:29:31 +01:00
|
|
|
float fade_in = 0.1;
|
|
|
|
float fade_out = 0.1;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2021-02-07 22:29:31 +01:00
|
|
|
bool autorestart = false;
|
|
|
|
float autorestart_delay = 1.0;
|
|
|
|
float autorestart_random_delay = 0.0;
|
|
|
|
MixMode mix = MIX_MODE_BLEND;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2021-02-07 22:29:31 +01:00
|
|
|
bool sync = false;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2018-08-20 18:38:18 +02:00
|
|
|
/* bool active;
|
|
|
|
bool do_start;
|
|
|
|
float time;
|
|
|
|
float remaining;*/
|
|
|
|
|
2021-02-07 22:29:31 +01:00
|
|
|
StringName active = "active";
|
|
|
|
StringName prev_active = "prev_active";
|
|
|
|
StringName time = "time";
|
|
|
|
StringName remaining = "remaining";
|
|
|
|
StringName time_to_restart = "time_to_restart";
|
2018-08-20 18:38:18 +02:00
|
|
|
|
2018-06-19 03:10:48 +02:00
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
public:
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void get_parameter_list(List<PropertyInfo> *r_list) const override;
|
|
|
|
virtual Variant get_parameter_default_value(const StringName &p_parameter) const override;
|
2018-08-20 18:38:18 +02:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual String get_caption() const override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
void set_fadein_time(float p_time);
|
|
|
|
void set_fadeout_time(float p_time);
|
|
|
|
|
|
|
|
float get_fadein_time() const;
|
|
|
|
float get_fadeout_time() const;
|
|
|
|
|
|
|
|
void set_autorestart(bool p_active);
|
|
|
|
void set_autorestart_delay(float p_time);
|
|
|
|
void set_autorestart_random_delay(float p_time);
|
|
|
|
|
|
|
|
bool has_autorestart() const;
|
|
|
|
float get_autorestart_delay() const;
|
|
|
|
float get_autorestart_random_delay() const;
|
|
|
|
|
|
|
|
void set_mix_mode(MixMode p_mix);
|
|
|
|
MixMode get_mix_mode() const;
|
|
|
|
|
|
|
|
void set_use_sync(bool p_sync);
|
|
|
|
bool is_using_sync() const;
|
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual bool has_filter() const override;
|
2021-05-21 08:42:37 +02:00
|
|
|
virtual double process(double p_time, bool p_seek) override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
AnimationNodeOneShot();
|
|
|
|
};
|
|
|
|
|
|
|
|
VARIANT_ENUM_CAST(AnimationNodeOneShot::MixMode)
|
|
|
|
|
2018-06-28 01:50:25 +02:00
|
|
|
class AnimationNodeAdd2 : public AnimationNode {
|
|
|
|
GDCLASS(AnimationNodeAdd2, AnimationNode);
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2021-02-07 22:29:31 +01:00
|
|
|
StringName add_amount = "add_amount";
|
|
|
|
bool sync = false;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
public:
|
2020-07-10 12:34:39 +02:00
|
|
|
void get_parameter_list(List<PropertyInfo> *r_list) const override;
|
|
|
|
virtual Variant get_parameter_default_value(const StringName &p_parameter) const override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual String get_caption() const override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
void set_use_sync(bool p_sync);
|
|
|
|
bool is_using_sync() const;
|
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual bool has_filter() const override;
|
2021-05-21 08:42:37 +02:00
|
|
|
virtual double process(double p_time, bool p_seek) override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2018-06-28 01:50:25 +02:00
|
|
|
AnimationNodeAdd2();
|
|
|
|
};
|
|
|
|
|
|
|
|
class AnimationNodeAdd3 : public AnimationNode {
|
|
|
|
GDCLASS(AnimationNodeAdd3, AnimationNode);
|
|
|
|
|
2021-02-07 22:29:31 +01:00
|
|
|
StringName add_amount = "add_amount";
|
|
|
|
bool sync = false;
|
2018-06-28 01:50:25 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
public:
|
2020-07-10 12:34:39 +02:00
|
|
|
void get_parameter_list(List<PropertyInfo> *r_list) const override;
|
|
|
|
virtual Variant get_parameter_default_value(const StringName &p_parameter) const override;
|
2018-06-28 01:50:25 +02:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual String get_caption() const override;
|
2018-06-28 01:50:25 +02:00
|
|
|
|
|
|
|
void set_use_sync(bool p_sync);
|
|
|
|
bool is_using_sync() const;
|
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual bool has_filter() const override;
|
2021-05-21 08:42:37 +02:00
|
|
|
virtual double process(double p_time, bool p_seek) override;
|
2018-06-28 01:50:25 +02:00
|
|
|
|
|
|
|
AnimationNodeAdd3();
|
2018-06-19 03:10:48 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class AnimationNodeBlend2 : public AnimationNode {
|
|
|
|
GDCLASS(AnimationNodeBlend2, AnimationNode);
|
|
|
|
|
2021-02-07 22:29:31 +01:00
|
|
|
StringName blend_amount = "blend_amount";
|
|
|
|
bool sync = false;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
public:
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void get_parameter_list(List<PropertyInfo> *r_list) const override;
|
|
|
|
virtual Variant get_parameter_default_value(const StringName &p_parameter) const override;
|
2018-08-20 18:38:18 +02:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual String get_caption() const override;
|
2021-05-21 08:42:37 +02:00
|
|
|
virtual double process(double p_time, bool p_seek) override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
void set_use_sync(bool p_sync);
|
|
|
|
bool is_using_sync() const;
|
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual bool has_filter() const override;
|
2018-06-19 03:10:48 +02:00
|
|
|
AnimationNodeBlend2();
|
|
|
|
};
|
|
|
|
|
|
|
|
class AnimationNodeBlend3 : public AnimationNode {
|
|
|
|
GDCLASS(AnimationNodeBlend3, AnimationNode);
|
|
|
|
|
2018-08-20 18:38:18 +02:00
|
|
|
StringName blend_amount;
|
2018-06-19 03:10:48 +02:00
|
|
|
bool sync;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
public:
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void get_parameter_list(List<PropertyInfo> *r_list) const override;
|
|
|
|
virtual Variant get_parameter_default_value(const StringName &p_parameter) const override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual String get_caption() const override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
void set_use_sync(bool p_sync);
|
|
|
|
bool is_using_sync() const;
|
|
|
|
|
2021-05-21 08:42:37 +02:00
|
|
|
double process(double p_time, bool p_seek) override;
|
2018-06-19 03:10:48 +02:00
|
|
|
AnimationNodeBlend3();
|
|
|
|
};
|
|
|
|
|
|
|
|
class AnimationNodeTimeScale : public AnimationNode {
|
|
|
|
GDCLASS(AnimationNodeTimeScale, AnimationNode);
|
|
|
|
|
2021-02-07 22:29:31 +01:00
|
|
|
StringName scale = "scale";
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
public:
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void get_parameter_list(List<PropertyInfo> *r_list) const override;
|
|
|
|
virtual Variant get_parameter_default_value(const StringName &p_parameter) const override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual String get_caption() const override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2021-05-21 08:42:37 +02:00
|
|
|
double process(double p_time, bool p_seek) override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
AnimationNodeTimeScale();
|
|
|
|
};
|
|
|
|
|
|
|
|
class AnimationNodeTimeSeek : public AnimationNode {
|
|
|
|
GDCLASS(AnimationNodeTimeSeek, AnimationNode);
|
|
|
|
|
2021-02-07 22:29:31 +01:00
|
|
|
StringName seek_pos = "seek_position";
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
public:
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void get_parameter_list(List<PropertyInfo> *r_list) const override;
|
|
|
|
virtual Variant get_parameter_default_value(const StringName &p_parameter) const override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual String get_caption() const override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2021-05-21 08:42:37 +02:00
|
|
|
double process(double p_time, bool p_seek) override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
AnimationNodeTimeSeek();
|
|
|
|
};
|
|
|
|
|
|
|
|
class AnimationNodeTransition : public AnimationNode {
|
|
|
|
GDCLASS(AnimationNodeTransition, AnimationNode);
|
|
|
|
|
|
|
|
enum {
|
|
|
|
MAX_INPUTS = 32
|
|
|
|
};
|
|
|
|
struct InputData {
|
|
|
|
String name;
|
2021-02-07 22:29:31 +01:00
|
|
|
bool auto_advance = false;
|
2018-06-19 03:10:48 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
InputData inputs[MAX_INPUTS];
|
2021-02-07 22:29:31 +01:00
|
|
|
int enabled_inputs = 0;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2018-08-20 18:38:18 +02:00
|
|
|
/*
|
2018-06-19 03:10:48 +02:00
|
|
|
float prev_xfading;
|
|
|
|
int prev;
|
|
|
|
float time;
|
|
|
|
int current;
|
2018-08-20 18:38:18 +02:00
|
|
|
int prev_current; */
|
|
|
|
|
2021-02-07 22:29:31 +01:00
|
|
|
StringName prev_xfading = "prev_xfading";
|
|
|
|
StringName prev = "prev";
|
|
|
|
StringName time = "time";
|
|
|
|
StringName current = "current";
|
|
|
|
StringName prev_current = "prev_current";
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2021-02-07 22:29:31 +01:00
|
|
|
float xfade = 0.0;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
void _update_inputs();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
2020-07-10 12:34:39 +02:00
|
|
|
void _validate_property(PropertyInfo &property) const override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
public:
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void get_parameter_list(List<PropertyInfo> *r_list) const override;
|
|
|
|
virtual Variant get_parameter_default_value(const StringName &p_parameter) const override;
|
2018-08-20 18:38:18 +02:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual String get_caption() const override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
void set_enabled_inputs(int p_inputs);
|
|
|
|
int get_enabled_inputs();
|
|
|
|
|
|
|
|
void set_input_as_auto_advance(int p_input, bool p_enable);
|
|
|
|
bool is_input_set_as_auto_advance(int p_input) const;
|
|
|
|
|
|
|
|
void set_input_caption(int p_input, const String &p_name);
|
|
|
|
String get_input_caption(int p_input) const;
|
|
|
|
|
|
|
|
void set_cross_fade_time(float p_fade);
|
|
|
|
float get_cross_fade_time() const;
|
|
|
|
|
2021-05-21 08:42:37 +02:00
|
|
|
double process(double p_time, bool p_seek) override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
AnimationNodeTransition();
|
|
|
|
};
|
|
|
|
|
|
|
|
class AnimationNodeOutput : public AnimationNode {
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(AnimationNodeOutput, AnimationNode);
|
|
|
|
|
2018-06-19 03:10:48 +02:00
|
|
|
public:
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual String get_caption() const override;
|
2021-05-21 08:42:37 +02:00
|
|
|
virtual double process(double p_time, bool p_seek) override;
|
2018-06-19 03:10:48 +02:00
|
|
|
AnimationNodeOutput();
|
|
|
|
};
|
|
|
|
|
|
|
|
/////
|
|
|
|
|
2018-06-21 20:45:44 +02:00
|
|
|
class AnimationNodeBlendTree : public AnimationRootNode {
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(AnimationNodeBlendTree, AnimationRootNode);
|
2018-06-19 03:10:48 +02:00
|
|
|
|
2018-08-20 18:38:18 +02:00
|
|
|
struct Node {
|
|
|
|
Ref<AnimationNode> node;
|
|
|
|
Vector2 position;
|
|
|
|
Vector<StringName> connections;
|
|
|
|
};
|
|
|
|
|
|
|
|
Map<StringName, Node> nodes;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
Vector2 graph_offset;
|
|
|
|
|
2018-08-20 18:38:18 +02:00
|
|
|
void _tree_changed();
|
|
|
|
void _node_changed(const StringName &p_node);
|
|
|
|
|
2021-08-26 18:07:13 +02:00
|
|
|
void _initialize_node_tree();
|
|
|
|
|
2018-06-19 03:10:48 +02:00
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
bool _set(const StringName &p_name, const Variant &p_value);
|
|
|
|
bool _get(const StringName &p_name, Variant &r_ret) const;
|
|
|
|
void _get_property_list(List<PropertyInfo> *p_list) const;
|
|
|
|
|
2021-02-11 18:18:45 +01:00
|
|
|
virtual void reset_state() override;
|
|
|
|
|
2018-06-19 03:10:48 +02:00
|
|
|
public:
|
|
|
|
enum ConnectionError {
|
|
|
|
CONNECTION_OK,
|
|
|
|
CONNECTION_ERROR_NO_INPUT,
|
|
|
|
CONNECTION_ERROR_NO_INPUT_INDEX,
|
|
|
|
CONNECTION_ERROR_NO_OUTPUT,
|
|
|
|
CONNECTION_ERROR_SAME_NODE,
|
|
|
|
CONNECTION_ERROR_CONNECTION_EXISTS,
|
|
|
|
//no need to check for cycles due to tree topology
|
|
|
|
};
|
|
|
|
|
2018-08-20 18:38:18 +02:00
|
|
|
void add_node(const StringName &p_name, Ref<AnimationNode> p_node, const Vector2 &p_position = Vector2());
|
2018-06-19 03:10:48 +02:00
|
|
|
Ref<AnimationNode> get_node(const StringName &p_name) const;
|
|
|
|
void remove_node(const StringName &p_name);
|
|
|
|
void rename_node(const StringName &p_name, const StringName &p_new_name);
|
|
|
|
bool has_node(const StringName &p_name) const;
|
|
|
|
StringName get_node_name(const Ref<AnimationNode> &p_node) const;
|
2018-08-20 18:38:18 +02:00
|
|
|
Vector<StringName> get_node_connection_array(const StringName &p_name) const;
|
|
|
|
|
|
|
|
void set_node_position(const StringName &p_node, const Vector2 &p_position);
|
|
|
|
Vector2 get_node_position(const StringName &p_node) const;
|
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void get_child_nodes(List<ChildNode> *r_child_nodes) override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
void connect_node(const StringName &p_input_node, int p_input_index, const StringName &p_output_node);
|
|
|
|
void disconnect_node(const StringName &p_node, int p_input_index);
|
|
|
|
|
|
|
|
struct NodeConnection {
|
|
|
|
StringName input_node;
|
2021-02-07 22:29:31 +01:00
|
|
|
int input_index = 0;
|
2018-06-19 03:10:48 +02:00
|
|
|
StringName output_node;
|
|
|
|
};
|
|
|
|
|
|
|
|
ConnectionError can_connect_node(const StringName &p_input_node, int p_input_index, const StringName &p_output_node) const;
|
|
|
|
void get_node_connections(List<NodeConnection> *r_connections) const;
|
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual String get_caption() const override;
|
2021-05-21 08:42:37 +02:00
|
|
|
virtual double process(double p_time, bool p_seek) override;
|
2018-06-19 03:10:48 +02:00
|
|
|
|
|
|
|
void get_node_list(List<StringName> *r_list);
|
|
|
|
|
|
|
|
void set_graph_offset(const Vector2 &p_graph_offset);
|
|
|
|
Vector2 get_graph_offset() const;
|
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual Ref<AnimationNode> get_child_by_name(const StringName &p_name) override;
|
2018-08-20 18:38:18 +02:00
|
|
|
|
2018-06-19 03:10:48 +02:00
|
|
|
AnimationNodeBlendTree();
|
|
|
|
~AnimationNodeBlendTree();
|
|
|
|
};
|
|
|
|
|
|
|
|
VARIANT_ENUM_CAST(AnimationNodeBlendTree::ConnectionError)
|
|
|
|
|
|
|
|
#endif // ANIMATION_BLEND_TREE_H
|