summaryrefslogtreecommitdiff
path: root/scene/animation
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-06-25 18:40:24 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-06-25 18:40:24 -0300
commit8c7da84e1eae25302a0c88594cce88b84f2dc21e (patch)
tree5f9d2ce0c85c765016854d05831591de6ac17ccf /scene/animation
parent87f48e7a3ee7bbfbc746e9df3fcff68917ae5f76 (diff)
renamed AnimationGraphPlayer to AnimationTree
Diffstat (limited to 'scene/animation')
-rw-r--r--scene/animation/animation_blend_space_1d.cpp10
-rw-r--r--scene/animation/animation_blend_space_1d.h2
-rw-r--r--scene/animation/animation_blend_space_2d.cpp10
-rw-r--r--scene/animation/animation_blend_space_2d.h2
-rw-r--r--scene/animation/animation_blend_tree.cpp16
-rw-r--r--scene/animation/animation_blend_tree.h4
-rw-r--r--scene/animation/animation_node_state_machine.cpp12
-rw-r--r--scene/animation/animation_node_state_machine.h4
-rw-r--r--scene/animation/animation_tree.cpp (renamed from scene/animation/animation_graph_player.cpp)88
-rw-r--r--scene/animation/animation_tree.h (renamed from scene/animation/animation_graph_player.h)20
10 files changed, 84 insertions, 84 deletions
diff --git a/scene/animation/animation_blend_space_1d.cpp b/scene/animation/animation_blend_space_1d.cpp
index 6f659cc2bb..c9953b2761 100644
--- a/scene/animation/animation_blend_space_1d.cpp
+++ b/scene/animation/animation_blend_space_1d.cpp
@@ -67,7 +67,7 @@ void AnimationNodeBlendSpace1D::add_blend_point(const Ref<AnimationRootNode> &p_
blend_points[p_at_index].position = p_position;
blend_points[p_at_index].node->set_parent(this);
- blend_points[p_at_index].node->set_graph_player(get_graph_player());
+ blend_points[p_at_index].node->set_tree(get_tree());
blend_points_used++;
}
@@ -84,12 +84,12 @@ void AnimationNodeBlendSpace1D::set_blend_point_node(int p_point, const Ref<Anim
if (blend_points[p_point].node.is_valid()) {
blend_points[p_point].node->set_parent(NULL);
- blend_points[p_point].node->set_graph_player(NULL);
+ blend_points[p_point].node->set_tree(NULL);
}
blend_points[p_point].node = p_node;
blend_points[p_point].node->set_parent(this);
- blend_points[p_point].node->set_graph_player(get_graph_player());
+ blend_points[p_point].node->set_tree(get_tree());
}
float AnimationNodeBlendSpace1D::get_blend_point_position(int p_point) const {
@@ -106,7 +106,7 @@ void AnimationNodeBlendSpace1D::remove_blend_point(int p_point) {
ERR_FAIL_INDEX(p_point, blend_points_used);
blend_points[p_point].node->set_parent(NULL);
- blend_points[p_point].node->set_graph_player(NULL);
+ blend_points[p_point].node->set_tree(NULL);
for (int i = p_point; i < blend_points_used - 1; i++) {
blend_points[i] = blend_points[i + 1];
@@ -267,6 +267,6 @@ AnimationNodeBlendSpace1D::~AnimationNodeBlendSpace1D() {
for (int i = 0; i < blend_points_used; i++) {
blend_points[i].node->set_parent(this);
- blend_points[i].node->set_graph_player(get_graph_player());
+ blend_points[i].node->set_tree(get_tree());
}
}
diff --git a/scene/animation/animation_blend_space_1d.h b/scene/animation/animation_blend_space_1d.h
index 447c948e93..6e264076c4 100644
--- a/scene/animation/animation_blend_space_1d.h
+++ b/scene/animation/animation_blend_space_1d.h
@@ -1,7 +1,7 @@
#ifndef ANIMATION_BLEND_SPACE_1D_H
#define ANIMATION_BLEND_SPACE_1D_H
-#include "scene/animation/animation_graph_player.h"
+#include "scene/animation/animation_tree.h"
class AnimationNodeBlendSpace1D : public AnimationRootNode {
GDCLASS(AnimationNodeBlendSpace1D, AnimationRootNode)
diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp
index 675285b075..28e4ca4eda 100644
--- a/scene/animation/animation_blend_space_2d.cpp
+++ b/scene/animation/animation_blend_space_2d.cpp
@@ -25,7 +25,7 @@ void AnimationNodeBlendSpace2D::add_blend_point(const Ref<AnimationRootNode> &p_
blend_points[p_at_index].position = p_position;
blend_points[p_at_index].node->set_parent(this);
- blend_points[p_at_index].node->set_graph_player(get_graph_player());
+ blend_points[p_at_index].node->set_tree(get_tree());
blend_points_used++;
if (auto_triangles) {
@@ -46,11 +46,11 @@ void AnimationNodeBlendSpace2D::set_blend_point_node(int p_point, const Ref<Anim
if (blend_points[p_point].node.is_valid()) {
blend_points[p_point].node->set_parent(NULL);
- blend_points[p_point].node->set_graph_player(NULL);
+ blend_points[p_point].node->set_tree(NULL);
}
blend_points[p_point].node = p_node;
blend_points[p_point].node->set_parent(this);
- blend_points[p_point].node->set_graph_player(get_graph_player());
+ blend_points[p_point].node->set_tree(get_tree());
}
Vector2 AnimationNodeBlendSpace2D::get_blend_point_position(int p_point) const {
ERR_FAIL_INDEX_V(p_point, blend_points_used, Vector2());
@@ -64,7 +64,7 @@ void AnimationNodeBlendSpace2D::remove_blend_point(int p_point) {
ERR_FAIL_INDEX(p_point, blend_points_used);
blend_points[p_point].node->set_parent(NULL);
- blend_points[p_point].node->set_graph_player(NULL);
+ blend_points[p_point].node->set_tree(NULL);
for (int i = 0; i < triangles.size(); i++) {
bool erase = false;
@@ -553,6 +553,6 @@ AnimationNodeBlendSpace2D::~AnimationNodeBlendSpace2D() {
for (int i = 0; i < blend_points_used; i++) {
blend_points[i].node->set_parent(this);
- blend_points[i].node->set_graph_player(get_graph_player());
+ blend_points[i].node->set_tree(get_tree());
}
}
diff --git a/scene/animation/animation_blend_space_2d.h b/scene/animation/animation_blend_space_2d.h
index f8f2440088..5af0b9ba7f 100644
--- a/scene/animation/animation_blend_space_2d.h
+++ b/scene/animation/animation_blend_space_2d.h
@@ -1,7 +1,7 @@
#ifndef ANIMATION_BLEND_SPACE_2D_H
#define ANIMATION_BLEND_SPACE_2D_H
-#include "scene/animation/animation_graph_player.h"
+#include "scene/animation/animation_tree.h"
class AnimationNodeBlendSpace2D : public AnimationRootNode {
GDCLASS(AnimationNodeBlendSpace2D, AnimationRootNode)
diff --git a/scene/animation/animation_blend_tree.cpp b/scene/animation/animation_blend_tree.cpp
index ced0cbbbba..feacea5656 100644
--- a/scene/animation/animation_blend_tree.cpp
+++ b/scene/animation/animation_blend_tree.cpp
@@ -16,7 +16,7 @@ float AnimationNodeAnimation::get_playback_time() const {
void AnimationNodeAnimation::_validate_property(PropertyInfo &property) const {
if (property.name == "animation") {
- AnimationGraphPlayer *gp = get_graph_player();
+ AnimationTree *gp = get_tree();
if (gp && gp->has_node(gp->get_animation_player())) {
AnimationPlayer *ap = Object::cast_to<AnimationPlayer>(gp->get_node(gp->get_animation_player()));
if (ap) {
@@ -762,13 +762,13 @@ void AnimationNodeBlendTree::add_node(const StringName &p_name, Ref<AnimationNod
ERR_FAIL_COND(nodes.has(p_name));
ERR_FAIL_COND(p_node.is_null());
ERR_FAIL_COND(p_node->get_parent().is_valid());
- ERR_FAIL_COND(p_node->get_graph_player() != NULL);
+ ERR_FAIL_COND(p_node->get_tree() != NULL);
ERR_FAIL_COND(p_name == SceneStringNames::get_singleton()->output);
ERR_FAIL_COND(String(p_name).find("/") != -1);
nodes[p_name] = p_node;
p_node->set_parent(this);
- p_node->set_graph_player(get_graph_player());
+ p_node->set_tree(get_tree());
emit_changed();
}
@@ -804,7 +804,7 @@ void AnimationNodeBlendTree::remove_node(const StringName &p_name) {
node->set_input_connection(i, StringName());
}
node->set_parent(NULL);
- node->set_graph_player(NULL);
+ node->set_tree(NULL);
}
nodes.erase(p_name);
@@ -965,13 +965,13 @@ Vector2 AnimationNodeBlendTree::get_graph_offset() const {
return graph_offset;
}
-void AnimationNodeBlendTree::set_graph_player(AnimationGraphPlayer *p_player) {
+void AnimationNodeBlendTree::set_tree(AnimationTree *p_player) {
- AnimationNode::set_graph_player(p_player);
+ AnimationNode::set_tree(p_player);
for (Map<StringName, Ref<AnimationNode> >::Element *E = nodes.front(); E; E = E->next()) {
Ref<AnimationNode> node = E->get();
- node->set_graph_player(p_player);
+ node->set_tree(p_player);
}
}
@@ -1107,6 +1107,6 @@ AnimationNodeBlendTree::~AnimationNodeBlendTree() {
for (Map<StringName, Ref<AnimationNode> >::Element *E = nodes.front(); E; E = E->next()) {
E->get()->set_parent(NULL);
- E->get()->set_graph_player(NULL);
+ E->get()->set_tree(NULL);
}
}
diff --git a/scene/animation/animation_blend_tree.h b/scene/animation/animation_blend_tree.h
index 7623fd3e57..8d7932196c 100644
--- a/scene/animation/animation_blend_tree.h
+++ b/scene/animation/animation_blend_tree.h
@@ -1,7 +1,7 @@
#ifndef ANIMATION_BLEND_TREE_H
#define ANIMATION_BLEND_TREE_H
-#include "scene/animation/animation_graph_player.h"
+#include "scene/animation/animation_tree.h"
class AnimationNodeAnimation : public AnimationRootNode {
@@ -318,7 +318,7 @@ public:
void set_graph_offset(const Vector2 &p_graph_offset);
Vector2 get_graph_offset() const;
- virtual void set_graph_player(AnimationGraphPlayer *p_player);
+ virtual void set_tree(AnimationTree *p_player);
AnimationNodeBlendTree();
~AnimationNodeBlendTree();
};
diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp
index 4b4666803c..c5ad980806 100644
--- a/scene/animation/animation_node_state_machine.cpp
+++ b/scene/animation/animation_node_state_machine.cpp
@@ -91,12 +91,12 @@ void AnimationNodeStateMachine::add_node(const StringName &p_name, Ref<Animation
ERR_FAIL_COND(states.has(p_name));
ERR_FAIL_COND(p_node.is_null());
ERR_FAIL_COND(p_node->get_parent().is_valid());
- ERR_FAIL_COND(p_node->get_graph_player() != NULL);
+ ERR_FAIL_COND(p_node->get_tree() != NULL);
ERR_FAIL_COND(String(p_name).find("/") != -1);
states[p_name] = p_node;
p_node->set_parent(this);
- p_node->set_graph_player(get_graph_player());
+ p_node->set_tree(get_tree());
emit_changed();
}
@@ -132,7 +132,7 @@ void AnimationNodeStateMachine::remove_node(const StringName &p_name) {
node->set_input_connection(i, StringName());
}
node->set_parent(NULL);
- node->set_graph_player(NULL);
+ node->set_tree(NULL);
}
states.erase(p_name);
@@ -623,13 +623,13 @@ String AnimationNodeStateMachine::get_caption() const {
void AnimationNodeStateMachine::_notification(int p_what) {
}
-void AnimationNodeStateMachine::set_graph_player(AnimationGraphPlayer *p_player) {
+void AnimationNodeStateMachine::set_tree(AnimationTree *p_player) {
- AnimationNode::set_graph_player(p_player);
+ AnimationNode::set_tree(p_player);
for (Map<StringName, Ref<AnimationRootNode> >::Element *E = states.front(); E; E = E->next()) {
Ref<AnimationRootNode> node = E->get();
- node->set_graph_player(p_player);
+ node->set_tree(p_player);
}
}
diff --git a/scene/animation/animation_node_state_machine.h b/scene/animation/animation_node_state_machine.h
index 438a2f1855..e7357e09ea 100644
--- a/scene/animation/animation_node_state_machine.h
+++ b/scene/animation/animation_node_state_machine.h
@@ -1,7 +1,7 @@
#ifndef ANIMATION_NODE_STATE_MACHINE_H
#define ANIMATION_NODE_STATE_MACHINE_H
-#include "scene/animation/animation_graph_player.h"
+#include "scene/animation/animation_tree.h"
class AnimationNodeStateMachineTransition : public Resource {
GDCLASS(AnimationNodeStateMachineTransition, Resource)
@@ -134,7 +134,7 @@ public:
float get_current_play_pos() const;
float get_current_length() const;
- virtual void set_graph_player(AnimationGraphPlayer *p_player);
+ virtual void set_tree(AnimationTree *p_player);
AnimationNodeStateMachine();
};
diff --git a/scene/animation/animation_graph_player.cpp b/scene/animation/animation_tree.cpp
index b8efecebe9..7cc67b4cc3 100644
--- a/scene/animation/animation_graph_player.cpp
+++ b/scene/animation/animation_tree.cpp
@@ -1,4 +1,4 @@
-#include "animation_graph_player.h"
+#include "animation_tree.h"
#include "animation_blend_tree.h"
#include "core/method_bind_ext.gen.inc"
#include "engine.h"
@@ -56,11 +56,11 @@ void AnimationNode::make_invalid(const String &p_reason) {
float AnimationNode::blend_input(int p_input, float p_time, bool p_seek, float p_blend, FilterAction p_filter, bool p_optimize) {
ERR_FAIL_INDEX_V(p_input, inputs.size(), 0);
ERR_FAIL_COND_V(!state, 0);
- ERR_FAIL_COND_V(!get_graph_player(), 0); //should not happen, but used to catch bugs
+ ERR_FAIL_COND_V(!get_tree(), 0); //should not happen, but used to catch bugs
Ref<AnimationNodeBlendTree> tree = get_parent();
- if (!tree.is_valid() && get_graph_player()->get_graph_root().ptr() != this) {
+ if (!tree.is_valid() && get_tree()->get_graph_root().ptr() != this) {
make_invalid(RTR("Can't blend input because node is not in a tree"));
return 0;
}
@@ -204,10 +204,10 @@ String AnimationNode::get_input_name(int p_input) {
float AnimationNode::get_input_activity(int p_input) const {
ERR_FAIL_INDEX_V(p_input, inputs.size(), 0);
- if (!get_graph_player())
+ if (!get_tree())
return 0;
- if (get_graph_player()->get_last_process_pass() != inputs[p_input].last_pass) {
+ if (get_tree()->get_last_process_pass() != inputs[p_input].last_pass) {
return 0;
}
return inputs[p_input].activity;
@@ -265,7 +265,7 @@ Ref<AnimationNode> AnimationNode::get_parent() const {
return Ref<AnimationNode>();
}
-AnimationGraphPlayer *AnimationNode::get_graph_player() const {
+AnimationTree *AnimationNode::get_tree() const {
return player;
}
@@ -316,7 +316,7 @@ Vector2 AnimationNode::get_position() const {
return position;
}
-void AnimationNode::set_graph_player(AnimationGraphPlayer *p_player) {
+void AnimationNode::set_tree(AnimationTree *p_player) {
if (player != NULL && p_player == NULL) {
emit_signal("removed_from_graph");
@@ -398,10 +398,10 @@ AnimationNode::AnimationNode() {
////////////////////
-void AnimationGraphPlayer::set_graph_root(const Ref<AnimationNode> &p_root) {
+void AnimationTree::set_graph_root(const Ref<AnimationNode> &p_root) {
if (root.is_valid()) {
- root->set_graph_player(NULL);
+ root->set_tree(NULL);
}
if (p_root.is_valid()) {
ERR_EXPLAIN("root node already set to another player");
@@ -410,17 +410,17 @@ void AnimationGraphPlayer::set_graph_root(const Ref<AnimationNode> &p_root) {
root = p_root;
if (root.is_valid()) {
- root->set_graph_player(this);
+ root->set_tree(this);
}
update_configuration_warning();
}
-Ref<AnimationNode> AnimationGraphPlayer::get_graph_root() const {
+Ref<AnimationNode> AnimationTree::get_graph_root() const {
return root;
}
-void AnimationGraphPlayer::set_active(bool p_active) {
+void AnimationTree::set_active(bool p_active) {
if (active == p_active)
return;
@@ -447,12 +447,12 @@ void AnimationGraphPlayer::set_active(bool p_active) {
}
}
-bool AnimationGraphPlayer::is_active() const {
+bool AnimationTree::is_active() const {
return active;
}
-void AnimationGraphPlayer::set_process_mode(AnimationProcessMode p_mode) {
+void AnimationTree::set_process_mode(AnimationProcessMode p_mode) {
if (process_mode == p_mode)
return;
@@ -469,20 +469,20 @@ void AnimationGraphPlayer::set_process_mode(AnimationProcessMode p_mode) {
}
}
-AnimationGraphPlayer::AnimationProcessMode AnimationGraphPlayer::get_process_mode() const {
+AnimationTree::AnimationProcessMode AnimationTree::get_process_mode() const {
return process_mode;
}
-void AnimationGraphPlayer::_node_removed(Node *p_node) {
+void AnimationTree::_node_removed(Node *p_node) {
cache_valid = false;
}
-bool AnimationGraphPlayer::_update_caches(AnimationPlayer *player) {
+bool AnimationTree::_update_caches(AnimationPlayer *player) {
setup_pass++;
if (!player->has_node(player->get_root())) {
- ERR_PRINT("AnimationGraphPlayer: AnimationPlayer root is invalid.");
+ ERR_PRINT("AnimationTree: AnimationPlayer root is invalid.");
set_active(false);
return false;
}
@@ -517,7 +517,7 @@ bool AnimationGraphPlayer::_update_caches(AnimationPlayer *player) {
Node *child = parent->get_node_and_resource(path, resource, leftover_path);
if (!child) {
- ERR_PRINTS("AnimationGraphPlayer: '" + String(E->get()) + "', couldn't resolve track: '" + String(path) + "'");
+ ERR_PRINTS("AnimationTree: '" + String(E->get()) + "', couldn't resolve track: '" + String(path) + "'");
continue;
}
@@ -547,7 +547,7 @@ bool AnimationGraphPlayer::_update_caches(AnimationPlayer *player) {
Spatial *spatial = Object::cast_to<Spatial>(child);
if (!spatial) {
- ERR_PRINTS("AnimationGraphPlayer: '" + String(E->get()) + "', transform track does not point to spatial: '" + String(path) + "'");
+ ERR_PRINTS("AnimationTree: '" + String(E->get()) + "', transform track does not point to spatial: '" + String(path) + "'");
continue;
}
@@ -666,7 +666,7 @@ bool AnimationGraphPlayer::_update_caches(AnimationPlayer *player) {
return true;
}
-void AnimationGraphPlayer::_clear_caches() {
+void AnimationTree::_clear_caches() {
const NodePath *K = NULL;
while ((K = track_cache.next(K))) {
@@ -678,19 +678,19 @@ void AnimationGraphPlayer::_clear_caches() {
cache_valid = false;
}
-void AnimationGraphPlayer::_process_graph(float p_delta) {
+void AnimationTree::_process_graph(float p_delta) {
//check all tracks, see if they need modification
if (!root.is_valid()) {
- ERR_PRINT("AnimationGraphPlayer: root AnimationNode is not set, disabling playback.");
+ ERR_PRINT("AnimationTree: root AnimationNode is not set, disabling playback.");
set_active(false);
cache_valid = false;
return;
}
if (!has_node(animation_player)) {
- ERR_PRINT("AnimationGraphPlayer: no valid AnimationPlayer path set, disabling playback");
+ ERR_PRINT("AnimationTree: no valid AnimationPlayer path set, disabling playback");
set_active(false);
cache_valid = false;
return;
@@ -699,7 +699,7 @@ void AnimationGraphPlayer::_process_graph(float p_delta) {
AnimationPlayer *player = Object::cast_to<AnimationPlayer>(get_node(animation_player));
if (!player) {
- ERR_PRINT("AnimationGraphPlayer: path points to a node not an AnimationPlayer, disabling playback");
+ ERR_PRINT("AnimationTree: path points to a node not an AnimationPlayer, disabling playback");
set_active(false);
cache_valid = false;
return;
@@ -1093,7 +1093,7 @@ void AnimationGraphPlayer::_process_graph(float p_delta) {
}
}
-void AnimationGraphPlayer::_notification(int p_what) {
+void AnimationTree::_notification(int p_what) {
if (active && p_what == NOTIFICATION_INTERNAL_PHYSICS_PROCESS && process_mode == ANIMATION_PROCESS_PHYSICS) {
_process_graph(get_physics_process_delta_time());
@@ -1108,29 +1108,29 @@ void AnimationGraphPlayer::_notification(int p_what) {
}
}
-void AnimationGraphPlayer::set_animation_player(const NodePath &p_player) {
+void AnimationTree::set_animation_player(const NodePath &p_player) {
animation_player = p_player;
update_configuration_warning();
}
-NodePath AnimationGraphPlayer::get_animation_player() const {
+NodePath AnimationTree::get_animation_player() const {
return animation_player;
}
-bool AnimationGraphPlayer::is_state_invalid() const {
+bool AnimationTree::is_state_invalid() const {
return !state.valid;
}
-String AnimationGraphPlayer::get_invalid_state_reason() const {
+String AnimationTree::get_invalid_state_reason() const {
return state.invalid_reasons;
}
-uint64_t AnimationGraphPlayer::get_last_process_pass() const {
+uint64_t AnimationTree::get_last_process_pass() const {
return process_pass;
}
-String AnimationGraphPlayer::get_configuration_warning() const {
+String AnimationTree::get_configuration_warning() const {
String warning = Node::get_configuration_warning();
@@ -1174,20 +1174,20 @@ String AnimationGraphPlayer::get_configuration_warning() const {
return warning;
}
-void AnimationGraphPlayer::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_active", "active"), &AnimationGraphPlayer::set_active);
- ClassDB::bind_method(D_METHOD("is_active"), &AnimationGraphPlayer::is_active);
+void AnimationTree::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_active", "active"), &AnimationTree::set_active);
+ ClassDB::bind_method(D_METHOD("is_active"), &AnimationTree::is_active);
- ClassDB::bind_method(D_METHOD("set_graph_root", "root"), &AnimationGraphPlayer::set_graph_root);
- ClassDB::bind_method(D_METHOD("get_graph_root"), &AnimationGraphPlayer::get_graph_root);
+ ClassDB::bind_method(D_METHOD("set_graph_root", "root"), &AnimationTree::set_graph_root);
+ ClassDB::bind_method(D_METHOD("get_graph_root"), &AnimationTree::get_graph_root);
- ClassDB::bind_method(D_METHOD("set_process_mode", "mode"), &AnimationGraphPlayer::set_process_mode);
- ClassDB::bind_method(D_METHOD("get_process_mode"), &AnimationGraphPlayer::get_process_mode);
+ ClassDB::bind_method(D_METHOD("set_process_mode", "mode"), &AnimationTree::set_process_mode);
+ ClassDB::bind_method(D_METHOD("get_process_mode"), &AnimationTree::get_process_mode);
- ClassDB::bind_method(D_METHOD("set_animation_player", "root"), &AnimationGraphPlayer::set_animation_player);
- ClassDB::bind_method(D_METHOD("get_animation_player"), &AnimationGraphPlayer::get_animation_player);
+ ClassDB::bind_method(D_METHOD("set_animation_player", "root"), &AnimationTree::set_animation_player);
+ ClassDB::bind_method(D_METHOD("get_animation_player"), &AnimationTree::get_animation_player);
- ClassDB::bind_method(D_METHOD("_node_removed"), &AnimationGraphPlayer::_node_removed);
+ ClassDB::bind_method(D_METHOD("_node_removed"), &AnimationTree::_node_removed);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "graph_root", PROPERTY_HINT_RESOURCE_TYPE, "AnimationRootNode", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE), "set_graph_root", "get_graph_root");
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "anim_player"), "set_animation_player", "get_animation_player");
@@ -1195,7 +1195,7 @@ void AnimationGraphPlayer::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_process_mode", "get_process_mode");
}
-AnimationGraphPlayer::AnimationGraphPlayer() {
+AnimationTree::AnimationTree() {
process_mode = ANIMATION_PROCESS_IDLE;
active = false;
@@ -1204,7 +1204,7 @@ AnimationGraphPlayer::AnimationGraphPlayer() {
started = true;
}
-AnimationGraphPlayer::~AnimationGraphPlayer() {
+AnimationTree::~AnimationTree() {
if (root.is_valid()) {
root->player = NULL;
}
diff --git a/scene/animation/animation_graph_player.h b/scene/animation/animation_tree.h
index 8952be75c9..adc25d5607 100644
--- a/scene/animation/animation_graph_player.h
+++ b/scene/animation/animation_tree.h
@@ -8,7 +8,7 @@
class AnimationNodeBlendTree;
class AnimationPlayer;
-class AnimationGraphPlayer;
+class AnimationTree;
class AnimationNode : public Resource {
GDCLASS(AnimationNode, Resource)
@@ -32,7 +32,7 @@ public:
float process_input(int p_input, float p_time, bool p_seek, float p_blend);
- friend class AnimationGraphPlayer;
+ friend class AnimationTree;
struct AnimationState {
@@ -62,7 +62,7 @@ public:
Vector2 position;
AnimationNode *parent;
- AnimationGraphPlayer *player;
+ AnimationTree *player;
float _blend_node(Ref<AnimationNode> p_node, float p_time, bool p_seek, float p_blend, FilterAction p_filter = FILTER_IGNORE, bool p_optimize = true, float *r_max = NULL);
@@ -85,8 +85,8 @@ protected:
public:
void set_parent(AnimationNode *p_parent);
Ref<AnimationNode> get_parent() const;
- virtual void set_graph_player(AnimationGraphPlayer *p_player);
- AnimationGraphPlayer *get_graph_player() const;
+ virtual void set_tree(AnimationTree *p_player);
+ AnimationTree *get_tree() const;
AnimationPlayer *get_player() const;
virtual float process(float p_time, bool p_seek);
@@ -125,8 +125,8 @@ public:
AnimationRootNode() {}
};
-class AnimationGraphPlayer : public Node {
- GDCLASS(AnimationGraphPlayer, Node)
+class AnimationTree : public Node {
+ GDCLASS(AnimationTree, Node)
public:
enum AnimationProcessMode {
ANIMATION_PROCESS_PHYSICS,
@@ -258,10 +258,10 @@ public:
String get_invalid_state_reason() const;
uint64_t get_last_process_pass() const;
- AnimationGraphPlayer();
- ~AnimationGraphPlayer();
+ AnimationTree();
+ ~AnimationTree();
};
-VARIANT_ENUM_CAST(AnimationGraphPlayer::AnimationProcessMode)
+VARIANT_ENUM_CAST(AnimationTree::AnimationProcessMode)
#endif // ANIMATION_GRAPH_PLAYER_H