Ver código fonte

Merge pull request #31964 from nekomatata/fix-animation-player-error

Fixed switching back to AnimationPlayerEditor with empty animation list
Rémi Verschelde 5 anos atrás
pai
commit
2add51d082
1 arquivos alterados com 4 adições e 2 exclusões
  1. 4 2
      editor/plugins/animation_player_editor_plugin.cpp

+ 4 - 2
editor/plugins/animation_player_editor_plugin.cpp

@@ -690,8 +690,10 @@ void AnimationPlayerEditor::set_state(const Dictionary &p_state) {
 
 			if (p_state.has("animation")) {
 				String anim = p_state["animation"];
-				_select_anim_by_name(anim);
-				_animation_edit();
+				if (!anim.empty() && player->has_animation(anim)) {
+					_select_anim_by_name(anim);
+					_animation_edit();
+				}
 			}
 		}
 	}