summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-05-18 15:24:21 +0200
committerGitHub <noreply@github.com>2022-05-18 15:24:21 +0200
commit5b3d5962858dbd096ddfe01bc214cdfc55fef473 (patch)
tree5a783f3843b7b21f57ee7cb432d9623298edc3e5 /editor
parent4e6f5bfe91027b2bb3207f281a213d545c7769d6 (diff)
parentba8398f27081f2b33accf08e26044c0a9d8a66cb (diff)
Merge pull request #60774 from TokageItLab/root-seek-mode
Fixed broken root motion calculation in internal process of `AnimationBlendTree` such as `NodeOneShot`
Diffstat (limited to 'editor')
-rw-r--r--editor/animation_track_editor.cpp18
-rw-r--r--editor/animation_track_editor.h8
-rw-r--r--editor/import/resource_importer_scene.cpp2
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp2
4 files changed, 15 insertions, 15 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 7d8197bead..b676704347 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -1417,14 +1417,14 @@ void AnimationTimelineEdit::_anim_length_changed(double p_new_len) {
void AnimationTimelineEdit::_anim_loop_pressed() {
undo_redo->create_action(TTR("Change Animation Loop"));
switch (animation->get_loop_mode()) {
- case Animation::LoopMode::LOOP_NONE: {
- undo_redo->add_do_method(animation.ptr(), "set_loop_mode", Animation::LoopMode::LOOP_LINEAR);
+ case Animation::LOOP_NONE: {
+ undo_redo->add_do_method(animation.ptr(), "set_loop_mode", Animation::LOOP_LINEAR);
} break;
- case Animation::LoopMode::LOOP_LINEAR: {
- undo_redo->add_do_method(animation.ptr(), "set_loop_mode", Animation::LoopMode::LOOP_PINGPONG);
+ case Animation::LOOP_LINEAR: {
+ undo_redo->add_do_method(animation.ptr(), "set_loop_mode", Animation::LOOP_PINGPONG);
} break;
- case Animation::LoopMode::LOOP_PINGPONG: {
- undo_redo->add_do_method(animation.ptr(), "set_loop_mode", Animation::LoopMode::LOOP_NONE);
+ case Animation::LOOP_PINGPONG: {
+ undo_redo->add_do_method(animation.ptr(), "set_loop_mode", Animation::LOOP_NONE);
} break;
default:
break;
@@ -1724,15 +1724,15 @@ void AnimationTimelineEdit::update_values() {
}
switch (animation->get_loop_mode()) {
- case Animation::LoopMode::LOOP_NONE: {
+ case Animation::LOOP_NONE: {
loop->set_icon(get_theme_icon(SNAME("Loop"), SNAME("EditorIcons")));
loop->set_pressed(false);
} break;
- case Animation::LoopMode::LOOP_LINEAR: {
+ case Animation::LOOP_LINEAR: {
loop->set_icon(get_theme_icon(SNAME("Loop"), SNAME("EditorIcons")));
loop->set_pressed(true);
} break;
- case Animation::LoopMode::LOOP_PINGPONG: {
+ case Animation::LOOP_PINGPONG: {
loop->set_icon(get_theme_icon(SNAME("PingPongLoop"), SNAME("EditorIcons")));
loop->set_pressed(true);
} break;
diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h
index 07c3ed9990..55c3bd922a 100644
--- a/editor/animation_track_editor.h
+++ b/editor/animation_track_editor.h
@@ -478,10 +478,10 @@ class AnimationTrackEditor : public VBoxContainer {
struct TrackClipboard {
NodePath full_path;
NodePath base_path;
- Animation::TrackType track_type = Animation::TrackType::TYPE_ANIMATION;
- Animation::InterpolationType interp_type = Animation::InterpolationType::INTERPOLATION_CUBIC;
- Animation::UpdateMode update_mode = Animation::UpdateMode::UPDATE_CAPTURE;
- Animation::LoopMode loop_mode = Animation::LoopMode::LOOP_LINEAR;
+ Animation::TrackType track_type = Animation::TYPE_ANIMATION;
+ Animation::InterpolationType interp_type = Animation::INTERPOLATION_CUBIC;
+ Animation::UpdateMode update_mode = Animation::UPDATE_CAPTURE;
+ Animation::LoopMode loop_mode = Animation::LOOP_LINEAR;
bool loop_wrap = false;
bool enabled = false;
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp
index 647eb1344b..4f666730d5 100644
--- a/editor/import/resource_importer_scene.cpp
+++ b/editor/import/resource_importer_scene.cpp
@@ -466,7 +466,7 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, HashMap<R
static const char *loop_strings[loop_string_count] = { "loop_mode", "loop", "cycle" };
for (int i = 0; i < loop_string_count; i++) {
if (_teststr(animname, loop_strings[i])) {
- anim->set_loop_mode(Animation::LoopMode::LOOP_LINEAR);
+ anim->set_loop_mode(Animation::LOOP_LINEAR);
animname = _fixstr(animname, loop_strings[i]);
Ref<AnimationLibrary> library = ap->get_animation_library(ap->find_animation_library(anim));
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 581dab84b4..57cf13d298 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -1338,7 +1338,7 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
float pos = cpos + step_off * anim->get_step();
- bool valid = anim->get_loop_mode() != Animation::LoopMode::LOOP_NONE || (pos >= 0 && pos <= anim->get_length());
+ bool valid = anim->get_loop_mode() != Animation::LOOP_NONE || (pos >= 0 && pos <= anim->get_length());
onion.captures_valid.write[cidx] = valid;
if (valid) {
player->seek(pos, true);