Merge pull request #24221 from YeldhamDev/deprecate_animation_tree_player

Warn about AnimationTreePlayer's deprecation
This commit is contained in:
Rémi Verschelde 2018-12-09 21:46:34 +01:00 committed by GitHub
commit 1830b122e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -401,6 +401,9 @@ void AnimationTreePlayer::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE: { case NOTIFICATION_ENTER_TREE: {
ERR_EXPLAIN("AnimationTreePlayer has been deprecated. Use AnimationTree instead.");
WARN_DEPRECATED
if (!processing) { if (!processing) {
//make sure that a previous process state was not saved //make sure that a previous process state was not saved
//only process if "processing" is set //only process if "processing" is set
@ -409,12 +412,14 @@ void AnimationTreePlayer::_notification(int p_what) {
} }
} break; } break;
case NOTIFICATION_READY: { case NOTIFICATION_READY: {
dirty_caches = true; dirty_caches = true;
if (master != NodePath()) { if (master != NodePath()) {
_update_sources(); _update_sources();
} }
} break; } break;
case NOTIFICATION_INTERNAL_PROCESS: { case NOTIFICATION_INTERNAL_PROCESS: {
if (animation_process_mode == ANIMATION_PROCESS_PHYSICS) if (animation_process_mode == ANIMATION_PROCESS_PHYSICS)
break; break;
@ -1715,6 +1720,11 @@ Error AnimationTreePlayer::node_rename(const StringName &p_node, const StringNam
return OK; return OK;
} }
String AnimationTreePlayer::get_configuration_warning() const {
return TTR("This node has been deprecated. Use AnimationTree instead.");
}
void AnimationTreePlayer::_bind_methods() { void AnimationTreePlayer::_bind_methods() {
ClassDB::bind_method(D_METHOD("add_node", "type", "id"), &AnimationTreePlayer::add_node); ClassDB::bind_method(D_METHOD("add_node", "type", "id"), &AnimationTreePlayer::add_node);

View File

@ -343,6 +343,8 @@ public:
int node_get_input_count(const StringName &p_node) const; int node_get_input_count(const StringName &p_node) const;
StringName node_get_input_source(const StringName &p_node, int p_input) const; StringName node_get_input_source(const StringName &p_node, int p_input) const;
String get_configuration_warning() const;
/* ANIMATION NODE */ /* ANIMATION NODE */
void animation_node_set_animation(const StringName &p_node, const Ref<Animation> &p_animation); 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; Ref<Animation> animation_node_get_animation(const StringName &p_node) const;