소스 검색

Merge pull request #60440 from KoBeWi/Ȑ̶̛̘̻̹̪͙̇̍̔͐̊̆̏̏̓̈́̉͌͘Ȩ̸͉̳̘̬̣̩̽̈́́̅̈́̕͝ͅS̷͓̮̙̪̪̺̭̰̓̎̌́͗͆͌̈́̒͋͊͘Ë̷̡̨͔̻͈̺͓̘͉́̏̍̓͋̋͠T̶̠̙͍̱̠̱̟͎͇̬̥̞̘͛̔̄̏̆̽̄̌̅͝ͅ

Rémi Verschelde 3 년 전
부모
커밋
6c20ade250
2개의 변경된 파일12개의 추가작업 그리고 4개의 파일을 삭제
  1. 10 2
      editor/animation_track_editor.cpp
  2. 2 2
      scene/animation/animation_tree.cpp

+ 10 - 2
editor/animation_track_editor.cpp

@@ -4076,12 +4076,20 @@ Ref<Animation> AnimationTrackEditor::_create_and_get_reset_animation() {
 	if (player->has_animation(SceneStringNames::get_singleton()->RESET)) {
 		return player->get_animation(SceneStringNames::get_singleton()->RESET);
 	} else {
+		Ref<AnimationLibrary> al;
+		if (!player->has_animation_library("")) {
+			al.instantiate();
+			player->add_animation_library("", al);
+		} else {
+			al = player->get_animation_library("");
+		}
+
 		Ref<Animation> reset_anim;
 		reset_anim.instantiate();
 		reset_anim->set_length(ANIM_MIN_LENGTH);
-		undo_redo->add_do_method(player, "add_animation", SceneStringNames::get_singleton()->RESET, reset_anim);
+		undo_redo->add_do_method(al.ptr(), "add_animation", SceneStringNames::get_singleton()->RESET, reset_anim);
 		undo_redo->add_do_method(AnimationPlayerEditor::get_singleton(), "_animation_player_changed", player);
-		undo_redo->add_undo_method(player, "remove_animation", SceneStringNames::get_singleton()->RESET);
+		undo_redo->add_undo_method(al.ptr(), "remove_animation", SceneStringNames::get_singleton()->RESET);
 		undo_redo->add_undo_method(AnimationPlayerEditor::get_singleton(), "_animation_player_changed", player);
 		return reset_anim;
 	}

+ 2 - 2
scene/animation/animation_tree.cpp

@@ -541,9 +541,9 @@ bool AnimationTree::_update_caches(AnimationPlayer *player) {
 	player->get_animation_list(&sname);
 
 	Ref<Animation> reset_anim;
-	bool has_reset_anim = player->has_animation("RESET");
+	bool has_reset_anim = player->has_animation(SceneStringNames::get_singleton()->RESET);
 	if (has_reset_anim) {
-		reset_anim = player->get_animation("RESET");
+		reset_anim = player->get_animation(SceneStringNames::get_singleton()->RESET);
 	}
 	for (const StringName &E : sname) {
 		Ref<Animation> anim = player->get_animation(E);