diff options
Diffstat (limited to 'scene/animation')
-rw-r--r-- | scene/animation/animation_node_state_machine.cpp | 2 | ||||
-rw-r--r-- | scene/animation/animation_player.cpp | 8 | ||||
-rw-r--r-- | scene/animation/animation_tree.cpp | 37 | ||||
-rw-r--r-- | scene/animation/animation_tree.h | 2 | ||||
-rw-r--r-- | scene/animation/tween.cpp | 2 |
5 files changed, 20 insertions, 31 deletions
diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index d46f24752e..246fff6d57 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -281,7 +281,7 @@ bool AnimationNodeStateMachinePlayback::_travel(AnimationNodeStateMachine *p_sta at = cost_map[at].prev; } - path.invert(); + path.reverse(); return true; } diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 2c19307c52..0c1798a876 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -605,7 +605,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, float } if (p_seeked) { - //find whathever should be playing + //find whatever should be playing int idx = a->track_find_key(i, p_time); if (idx < 0) { continue; @@ -634,7 +634,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, float nc->audio_playing = true; playing_caches.insert(nc); - if (len && end_ofs > 0) { //force a end at a time + if (len && end_ofs > 0) { //force an end at a time nc->audio_len = len - start_ofs - end_ofs; } else { nc->audio_len = 0; @@ -665,7 +665,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, float nc->audio_playing = true; playing_caches.insert(nc); - if (len && end_ofs > 0) { //force a end at a time + if (len && end_ofs > 0) { //force an end at a time nc->audio_len = len - start_ofs - end_ofs; } else { nc->audio_len = 0; @@ -1343,7 +1343,7 @@ void AnimationPlayer::_stop_playing_caches() { } void AnimationPlayer::_node_removed(Node *p_node) { - clear_caches(); // nodes contained here ar being removed, clear the caches + clear_caches(); // nodes contained here are being removed, clear the caches } void AnimationPlayer::clear_caches() { diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index 26a13f33c9..44f2d38a84 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -458,7 +458,7 @@ void AnimationTree::set_tree_root(const Ref<AnimationNode> &p_root) { properties_dirty = true; - update_configuration_warning(); + update_configuration_warnings(); } Ref<AnimationNode> AnimationTree::get_tree_root() const { @@ -1009,7 +1009,7 @@ void AnimationTree::_process_graph(float p_delta) { TrackCacheAudio *t = static_cast<TrackCacheAudio *>(track); if (seeked) { - //find whathever should be playing + //find whatever should be playing int idx = a->track_find_key(i, time); if (idx < 0) { continue; @@ -1038,7 +1038,7 @@ void AnimationTree::_process_graph(float p_delta) { t->playing = true; playing_caches.insert(t); - if (len && end_ofs > 0) { //force a end at a time + if (len && end_ofs > 0) { //force an end at a time t->len = len - start_ofs - end_ofs; } else { t->len = 0; @@ -1069,7 +1069,7 @@ void AnimationTree::_process_graph(float p_delta) { t->playing = true; playing_caches.insert(t); - if (len && end_ofs > 0) { //force a end at a time + if (len && end_ofs > 0) { //force an end at a time t->len = len - start_ofs - end_ofs; } else { t->len = 0; @@ -1262,7 +1262,7 @@ void AnimationTree::_notification(int p_what) { void AnimationTree::set_animation_player(const NodePath &p_player) { animation_player = p_player; - update_configuration_warning(); + update_configuration_warnings(); } NodePath AnimationTree::get_animation_player() const { @@ -1281,38 +1281,26 @@ uint64_t AnimationTree::get_last_process_pass() const { return process_pass; } -String AnimationTree::get_configuration_warning() const { - String warning = Node::get_configuration_warning(); +TypedArray<String> AnimationTree::get_configuration_warnings() const { + TypedArray<String> warnings = Node::get_configuration_warnings(); if (!root.is_valid()) { - if (!warning.is_empty()) { - warning += "\n\n"; - } - warning += TTR("No root AnimationNode for the graph is set."); + warnings.push_back(TTR("No root AnimationNode for the graph is set.")); } if (!has_node(animation_player)) { - if (!warning.is_empty()) { - warning += "\n\n"; - } - warning += TTR("Path to an AnimationPlayer node containing animations is not set."); + warnings.push_back(TTR("Path to an AnimationPlayer node containing animations is not set.")); } else { AnimationPlayer *player = Object::cast_to<AnimationPlayer>(get_node(animation_player)); if (!player) { - if (!warning.is_empty()) { - warning += "\n\n"; - } - warning += TTR("Path set for AnimationPlayer does not lead to an AnimationPlayer node."); + warnings.push_back(TTR("Path set for AnimationPlayer does not lead to an AnimationPlayer node.")); } else if (!player->has_node(player->get_root())) { - if (!warning.is_empty()) { - warning += "\n\n"; - } - warning += TTR("The AnimationPlayer root node is not a valid node."); + warnings.push_back(TTR("The AnimationPlayer root node is not a valid node.")); } } - return warning; + return warnings; } void AnimationTree::set_root_motion_track(const NodePath &p_track) { @@ -1337,6 +1325,7 @@ void AnimationTree::_tree_changed() { } void AnimationTree::_update_properties_for_node(const String &p_base_path, Ref<AnimationNode> node) { + ERR_FAIL_COND(node.is_null()); if (!property_parent_map.has(p_base_path)) { property_parent_map[p_base_path] = HashMap<StringName, StringName>(); } diff --git a/scene/animation/animation_tree.h b/scene/animation/animation_tree.h index 1c5aec26ab..700ff1cb5b 100644 --- a/scene/animation/animation_tree.h +++ b/scene/animation/animation_tree.h @@ -300,7 +300,7 @@ public: void set_animation_player(const NodePath &p_player); NodePath get_animation_player() const; - virtual String get_configuration_warning() const override; + TypedArray<String> get_configuration_warnings() const override; bool is_state_invalid() const; String get_invalid_state_reason() const; diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index eb35979a47..2030808724 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -1115,7 +1115,7 @@ real_t Tween::tell() const { // For each interpolation... for (const List<InterpolateData>::Element *E = interpolates.front(); E; E = E->next()) { - // Get the data and figure out if it's position is further along than the previous ones + // Get the data and figure out if its position is further along than the previous ones const InterpolateData &data = E->get(); if (data.elapsed > pos) { // Save it if so |