From ece3df39386af85b069cbb67ae1893b4365f1bd3 Mon Sep 17 00:00:00 2001 From: kobewi Date: Fri, 25 Mar 2022 18:06:46 +0100 Subject: Add per-scene UndoRedo --- scene/animation/animation_player.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scene/animation') diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 1a7bf4c302..1af12a90f2 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -37,6 +37,7 @@ #ifdef TOOLS_ENABLED #include "editor/editor_node.h" +#include "editor/editor_undo_redo_manager.h" #include "scene/2d/skeleton_2d.h" void AnimatedValuesBackup::update_skeletons() { @@ -2046,7 +2047,7 @@ Ref AnimationPlayer::apply_reset(bool p_user_initiated) { Ref new_values = aux_player->backup_animated_values(); old_values->restore(); - UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); + Ref &ur = EditorNode::get_undo_redo(); ur->create_action(TTR("Anim Apply Reset")); ur->add_do_method(new_values.ptr(), "restore"); ur->add_undo_method(old_values.ptr(), "restore"); -- cgit v1.2.3