2014-02-10 01:10:30 +00:00
|
|
|
/*************************************************************************/
|
|
|
|
/* animation_tree_player.h */
|
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
2017-08-27 12:16:55 +00:00
|
|
|
/* https://godotengine.org */
|
2014-02-10 01:10:30 +00:00
|
|
|
/*************************************************************************/
|
2018-01-01 13:40:08 +00:00
|
|
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
2014-02-10 01:10:30 +00: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-01-04 23:50:27 +00:00
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
#ifndef ANIMATION_TREE_PLAYER_H
|
|
|
|
#define ANIMATION_TREE_PLAYER_H
|
|
|
|
|
2015-09-02 12:11:34 +00:00
|
|
|
#include "animation_player.h"
|
2017-03-05 15:44:50 +00:00
|
|
|
#include "scene/3d/skeleton.h"
|
|
|
|
#include "scene/3d/spatial.h"
|
|
|
|
#include "scene/resources/animation.h"
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
class AnimationTreePlayer : public Node {
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
GDCLASS(AnimationTreePlayer, Node);
|
2014-02-10 01:10:30 +00:00
|
|
|
OBJ_CATEGORY("Animation Nodes");
|
|
|
|
|
|
|
|
public:
|
2015-09-02 12:11:34 +00:00
|
|
|
enum AnimationProcessMode {
|
2017-09-30 14:19:07 +00:00
|
|
|
ANIMATION_PROCESS_PHYSICS,
|
2015-09-02 12:11:34 +00:00
|
|
|
ANIMATION_PROCESS_IDLE,
|
|
|
|
};
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
enum NodeType {
|
|
|
|
|
|
|
|
NODE_OUTPUT,
|
|
|
|
NODE_ANIMATION,
|
|
|
|
NODE_ONESHOT,
|
|
|
|
NODE_MIX,
|
|
|
|
NODE_BLEND2,
|
|
|
|
NODE_BLEND3,
|
|
|
|
NODE_BLEND4,
|
|
|
|
NODE_TIMESCALE,
|
|
|
|
NODE_TIMESEEK,
|
|
|
|
NODE_TRANSITION,
|
|
|
|
|
|
|
|
NODE_MAX,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ConnectError {
|
|
|
|
|
|
|
|
CONNECT_OK,
|
|
|
|
CONNECT_INCOMPLETE,
|
|
|
|
CONNECT_CYCLE
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
|
|
|
enum {
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
DISCONNECTED = -1,
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct TrackKey {
|
|
|
|
|
|
|
|
uint32_t id;
|
2017-05-30 20:20:15 +00:00
|
|
|
StringName subpath_concatenated;
|
2014-02-10 01:10:30 +00:00
|
|
|
int bone_idx;
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
inline bool operator<(const TrackKey &p_right) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
if (id == p_right.id) {
|
|
|
|
if (bone_idx == p_right.bone_idx) {
|
2017-05-30 20:20:15 +00:00
|
|
|
return subpath_concatenated < p_right.subpath_concatenated;
|
2014-02-10 01:10:30 +00:00
|
|
|
} else
|
2017-03-05 15:44:50 +00:00
|
|
|
return bone_idx < p_right.bone_idx;
|
2014-02-10 01:10:30 +00:00
|
|
|
} else
|
2017-03-05 15:44:50 +00:00
|
|
|
return id < p_right.id;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Track {
|
|
|
|
uint32_t id;
|
2016-04-12 00:10:35 +00:00
|
|
|
Object *object;
|
2017-03-05 15:44:50 +00:00
|
|
|
Spatial *spatial;
|
2014-02-10 01:10:30 +00:00
|
|
|
Skeleton *skeleton;
|
|
|
|
int bone_idx;
|
2017-05-30 20:20:15 +00:00
|
|
|
Vector<StringName> subpath;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Vector3 loc;
|
|
|
|
Quat rot;
|
|
|
|
Vector3 scale;
|
|
|
|
|
2016-04-12 15:54:17 +00:00
|
|
|
Variant value;
|
|
|
|
|
2016-04-25 09:41:23 +00:00
|
|
|
bool skip;
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
typedef Map<TrackKey, Track> TrackMap;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
TrackMap track_map;
|
|
|
|
|
|
|
|
struct Input {
|
|
|
|
|
|
|
|
StringName node;
|
|
|
|
//Input() { node=-1; }
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NodeBase {
|
|
|
|
|
|
|
|
bool cycletest;
|
|
|
|
|
|
|
|
NodeType type;
|
|
|
|
Point2 pos;
|
|
|
|
|
|
|
|
Vector<Input> inputs;
|
|
|
|
|
|
|
|
NodeBase() { cycletest = false; };
|
2017-03-05 15:44:50 +00:00
|
|
|
virtual ~NodeBase() { cycletest = false; }
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct NodeOut : public NodeBase {
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
NodeOut() {
|
|
|
|
type = NODE_OUTPUT;
|
|
|
|
inputs.resize(1);
|
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct AnimationNode : public NodeBase {
|
|
|
|
|
|
|
|
Ref<Animation> animation;
|
|
|
|
|
|
|
|
struct TrackRef {
|
|
|
|
int local_track;
|
|
|
|
Track *track;
|
|
|
|
float weight;
|
|
|
|
};
|
|
|
|
|
|
|
|
uint64_t last_version;
|
|
|
|
List<TrackRef> tref;
|
|
|
|
AnimationNode *next;
|
|
|
|
float time;
|
|
|
|
float step;
|
|
|
|
String from;
|
|
|
|
bool skip;
|
2016-04-25 09:41:23 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
HashMap<NodePath, bool> filter;
|
2016-04-25 09:41:23 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
AnimationNode() {
|
|
|
|
type = NODE_ANIMATION;
|
|
|
|
next = NULL;
|
|
|
|
last_version = 0;
|
|
|
|
skip = false;
|
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
struct OneShotNode : public NodeBase {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
bool active;
|
|
|
|
bool start;
|
|
|
|
float fade_in;
|
|
|
|
float fade_out;
|
|
|
|
|
|
|
|
bool autorestart;
|
|
|
|
float autorestart_delay;
|
|
|
|
float autorestart_random_delay;
|
|
|
|
bool mix;
|
|
|
|
|
|
|
|
float time;
|
|
|
|
float remaining;
|
|
|
|
float autorestart_remaining;
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
HashMap<NodePath, bool> filter;
|
|
|
|
|
|
|
|
OneShotNode() {
|
|
|
|
type = NODE_ONESHOT;
|
|
|
|
fade_in = 0;
|
|
|
|
fade_out = 0;
|
|
|
|
inputs.resize(2);
|
|
|
|
autorestart = false;
|
|
|
|
autorestart_delay = 1;
|
|
|
|
autorestart_remaining = 0;
|
|
|
|
mix = false;
|
|
|
|
active = false;
|
|
|
|
start = false;
|
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct MixNode : public NodeBase {
|
|
|
|
|
|
|
|
float amount;
|
2017-03-05 15:44:50 +00:00
|
|
|
MixNode() {
|
|
|
|
type = NODE_MIX;
|
|
|
|
inputs.resize(2);
|
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
struct Blend2Node : public NodeBase {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
float value;
|
2017-03-05 15:44:50 +00:00
|
|
|
HashMap<NodePath, bool> filter;
|
|
|
|
Blend2Node() {
|
|
|
|
type = NODE_BLEND2;
|
|
|
|
value = 0;
|
|
|
|
inputs.resize(2);
|
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Blend3Node : public NodeBase {
|
|
|
|
|
|
|
|
float value;
|
2017-03-05 15:44:50 +00:00
|
|
|
Blend3Node() {
|
|
|
|
type = NODE_BLEND3;
|
|
|
|
value = 0;
|
|
|
|
inputs.resize(3);
|
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Blend4Node : public NodeBase {
|
|
|
|
|
|
|
|
Point2 value;
|
2017-03-05 15:44:50 +00:00
|
|
|
Blend4Node() {
|
|
|
|
type = NODE_BLEND4;
|
|
|
|
inputs.resize(4);
|
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct TimeScaleNode : public NodeBase {
|
|
|
|
|
|
|
|
float scale;
|
2017-03-05 15:44:50 +00:00
|
|
|
TimeScaleNode() {
|
|
|
|
type = NODE_TIMESCALE;
|
|
|
|
scale = 1;
|
|
|
|
inputs.resize(1);
|
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct TimeSeekNode : public NodeBase {
|
|
|
|
|
|
|
|
float seek_pos;
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
TimeSeekNode() {
|
|
|
|
type = NODE_TIMESEEK;
|
|
|
|
inputs.resize(1);
|
|
|
|
seek_pos = -1;
|
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct TransitionNode : public NodeBase {
|
|
|
|
|
|
|
|
struct InputData {
|
|
|
|
|
|
|
|
bool auto_advance;
|
2017-03-05 15:44:50 +00:00
|
|
|
InputData() { auto_advance = false; }
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Vector<InputData> input_data;
|
|
|
|
|
|
|
|
float prev_time;
|
|
|
|
float prev_xfading;
|
|
|
|
int prev;
|
|
|
|
bool switched;
|
|
|
|
|
|
|
|
float time;
|
|
|
|
int current;
|
|
|
|
|
|
|
|
float xfade;
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
TransitionNode() {
|
|
|
|
type = NODE_TRANSITION;
|
|
|
|
xfade = 0;
|
|
|
|
inputs.resize(1);
|
|
|
|
input_data.resize(1);
|
|
|
|
current = 0;
|
|
|
|
prev = -1;
|
|
|
|
prev_time = 0;
|
|
|
|
prev_xfading = 0;
|
|
|
|
switched = false;
|
|
|
|
}
|
2016-04-06 19:09:00 +00:00
|
|
|
void set_current(int p_current);
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void _update_sources();
|
|
|
|
|
|
|
|
StringName out_name;
|
|
|
|
NodeOut *out;
|
|
|
|
|
|
|
|
NodePath base_path;
|
|
|
|
NodePath master;
|
|
|
|
|
|
|
|
ConnectError last_error;
|
|
|
|
AnimationNode *active_list;
|
2015-09-02 12:11:34 +00:00
|
|
|
AnimationProcessMode animation_process_mode;
|
|
|
|
bool processing;
|
2014-02-10 01:10:30 +00:00
|
|
|
bool active;
|
|
|
|
bool dirty_caches;
|
2017-03-05 15:44:50 +00:00
|
|
|
Map<StringName, NodeBase *> node_map;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
// return time left to finish animation
|
2017-08-11 19:10:05 +00:00
|
|
|
float _process_node(const StringName &p_node, AnimationNode **r_prev_anim, float p_time, bool p_seek = false, float p_fallback_weight = 1.0, HashMap<NodePath, float> *p_weights = NULL);
|
2015-09-02 12:11:34 +00:00
|
|
|
void _process_animation(float p_delta);
|
2014-02-10 01:10:30 +00:00
|
|
|
bool reset_request;
|
|
|
|
|
|
|
|
ConnectError _cycle_test(const StringName &p_at_node);
|
2017-12-24 17:21:59 +00:00
|
|
|
void _clear_cycle_test();
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
Track *_find_track(const NodePath &p_path);
|
2014-02-10 01:10:30 +00:00
|
|
|
void _recompute_caches();
|
2017-03-05 15:44:50 +00:00
|
|
|
void _recompute_caches(const StringName &p_node);
|
2017-01-07 21:25:37 +00:00
|
|
|
PoolVector<String> _get_node_list();
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void _compute_weights(float *p_fallback_weight, HashMap<NodePath, float> *p_weights, float p_coeff, const HashMap<NodePath, bool> *p_filter = NULL, float p_filtered_coeff = 0);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
protected:
|
|
|
|
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;
|
2014-02-10 01:10:30 +00:00
|
|
|
void _notification(int p_what);
|
|
|
|
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
public:
|
2017-03-05 15:44:50 +00:00
|
|
|
void add_node(NodeType p_type, const StringName &p_node); // nodes must be >0 node 0 is built-in (exit)
|
|
|
|
bool node_exists(const StringName &p_name) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
Error node_rename(const StringName &p_node, const StringName &p_new_name);
|
|
|
|
int node_get_input_count(const StringName &p_node) const;
|
|
|
|
StringName node_get_input_source(const StringName &p_node, int p_input) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
/* ANIMATION NODE */
|
2017-03-05 15:44:50 +00:00
|
|
|
void animation_node_set_animation(const StringName &p_node, const Ref<Animation> &p_animation);
|
|
|
|
Ref<Animation> animation_node_get_animation(const StringName &p_node) const;
|
|
|
|
void animation_node_set_master_animation(const StringName &p_node, const String &p_master_animation);
|
|
|
|
String animation_node_get_master_animation(const StringName &p_node) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-09-01 18:01:17 +00:00
|
|
|
void animation_node_set_filter_path(const StringName &p_node, const NodePath &p_track_path, bool p_filter);
|
2017-03-05 15:44:50 +00:00
|
|
|
void animation_node_set_get_filtered_paths(const StringName &p_node, List<NodePath> *r_paths) const;
|
|
|
|
bool animation_node_is_path_filtered(const StringName &p_node, const NodePath &p_path) const;
|
2016-04-25 09:41:23 +00:00
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
/* ONE SHOT NODE */
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void oneshot_node_set_fadein_time(const StringName &p_node, float p_time);
|
|
|
|
void oneshot_node_set_fadeout_time(const StringName &p_node, float p_time);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
float oneshot_node_get_fadein_time(const StringName &p_node) const;
|
|
|
|
float oneshot_node_get_fadeout_time(const StringName &p_node) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void oneshot_node_set_autorestart(const StringName &p_node, bool p_active);
|
|
|
|
void oneshot_node_set_autorestart_delay(const StringName &p_node, float p_time);
|
|
|
|
void oneshot_node_set_autorestart_random_delay(const StringName &p_node, float p_time);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
bool oneshot_node_has_autorestart(const StringName &p_node) const;
|
|
|
|
float oneshot_node_get_autorestart_delay(const StringName &p_node) const;
|
|
|
|
float oneshot_node_get_autorestart_random_delay(const StringName &p_node) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-08-11 19:10:05 +00:00
|
|
|
void oneshot_node_set_mix_mode(const StringName &p_node, bool p_mix);
|
2017-03-05 15:44:50 +00:00
|
|
|
bool oneshot_node_get_mix_mode(const StringName &p_node) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void oneshot_node_start(const StringName &p_node);
|
|
|
|
void oneshot_node_stop(const StringName &p_node);
|
|
|
|
bool oneshot_node_is_active(const StringName &p_node) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void oneshot_node_set_filter_path(const StringName &p_node, const NodePath &p_filter, bool p_enable);
|
|
|
|
void oneshot_node_set_get_filtered_paths(const StringName &p_node, List<NodePath> *r_paths) const;
|
|
|
|
bool oneshot_node_is_path_filtered(const StringName &p_node, const NodePath &p_path) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
/* MIX/BLEND NODES */
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void mix_node_set_amount(const StringName &p_node, float p_amount);
|
|
|
|
float mix_node_get_amount(const StringName &p_node) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void blend2_node_set_amount(const StringName &p_node, float p_amount);
|
|
|
|
float blend2_node_get_amount(const StringName &p_node) const;
|
|
|
|
void blend2_node_set_filter_path(const StringName &p_node, const NodePath &p_filter, bool p_enable);
|
|
|
|
void blend2_node_set_get_filtered_paths(const StringName &p_node, List<NodePath> *r_paths) const;
|
|
|
|
bool blend2_node_is_path_filtered(const StringName &p_node, const NodePath &p_path) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void blend3_node_set_amount(const StringName &p_node, float p_amount);
|
|
|
|
float blend3_node_get_amount(const StringName &p_node) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void blend4_node_set_amount(const StringName &p_node, const Point2 &p_amount);
|
|
|
|
Point2 blend4_node_get_amount(const StringName &p_node) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
/* TIMESCALE/TIMESEEK NODES */
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void timescale_node_set_scale(const StringName &p_node, float p_scale);
|
|
|
|
float timescale_node_get_scale(const StringName &p_node) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void timeseek_node_seek(const StringName &p_node, float p_pos);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
/* TRANSITION NODE */
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void transition_node_set_input_count(const StringName &p_node, int p_inputs); // used for transition node
|
|
|
|
int transition_node_get_input_count(const StringName &p_node) const;
|
|
|
|
void transition_node_delete_input(const StringName &p_node, int p_input); // used for transition node
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void transition_node_set_input_auto_advance(const StringName &p_node, int p_input, bool p_auto_advance); // used for transition node
|
|
|
|
bool transition_node_has_input_auto_advance(const StringName &p_node, int p_input) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void transition_node_set_xfade_time(const StringName &p_node, float p_time); // used for transition node
|
|
|
|
float transition_node_get_xfade_time(const StringName &p_node) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void transition_node_set_current(const StringName &p_node, int p_current);
|
|
|
|
int transition_node_get_current(const StringName &p_node) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-09-10 13:37:49 +00:00
|
|
|
void node_set_position(const StringName &p_node, const Vector2 &p_pos); //for display
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
/* GETS */
|
2017-09-10 13:37:49 +00:00
|
|
|
Point2 node_get_position(const StringName &p_node) const; //for display
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
NodeType node_get_type(const StringName &p_node) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
void get_node_list(List<StringName> *p_node_list) const;
|
2017-03-05 15:44:50 +00:00
|
|
|
void remove_node(const StringName &p_node);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
Error connect_nodes(const StringName &p_src_node, const StringName &p_dst_node, int p_dst_input);
|
2017-08-11 19:10:05 +00:00
|
|
|
bool are_nodes_connected(const StringName &p_src_node, const StringName &p_dst_node, int p_dst_input) const;
|
|
|
|
void disconnect_nodes(const StringName &p_node, int p_input);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void set_base_path(const NodePath &p_path);
|
2014-02-10 01:10:30 +00:00
|
|
|
NodePath get_base_path() const;
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void set_master_player(const NodePath &p_path);
|
2014-02-10 01:10:30 +00:00
|
|
|
NodePath get_master_player() const;
|
|
|
|
|
|
|
|
struct Connection {
|
|
|
|
|
|
|
|
StringName src_node;
|
|
|
|
StringName dst_node;
|
|
|
|
int dst_input;
|
|
|
|
};
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void get_connection_list(List<Connection> *p_connections) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
/* playback */
|
|
|
|
|
|
|
|
void set_active(bool p_active);
|
|
|
|
bool is_active() const;
|
|
|
|
|
|
|
|
void reset();
|
|
|
|
|
|
|
|
void recompute_caches();
|
|
|
|
|
|
|
|
ConnectError get_last_error() const;
|
|
|
|
|
2015-09-02 12:11:34 +00:00
|
|
|
void set_animation_process_mode(AnimationProcessMode p_mode);
|
|
|
|
AnimationProcessMode get_animation_process_mode() const;
|
|
|
|
|
|
|
|
void _set_process(bool p_process, bool p_force = false);
|
|
|
|
|
|
|
|
void advance(float p_time);
|
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
AnimationTreePlayer();
|
|
|
|
~AnimationTreePlayer();
|
|
|
|
};
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
VARIANT_ENUM_CAST(AnimationTreePlayer::NodeType);
|
|
|
|
VARIANT_ENUM_CAST(AnimationTreePlayer::AnimationProcessMode);
|
2015-09-02 12:11:34 +00:00
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
#endif // ANIMATION_TREE_PLAYER_H
|