浏览代码

Merge pull request #40063 from RandomShaper/clean_blend_times

Ignore (clean) blend times for non-existent animations
Rémi Verschelde 5 年之前
父节点
当前提交
810aefb3ed
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      scene/animation/animation_player.cpp

+ 2 - 0
scene/animation/animation_player.cpp

@@ -1055,6 +1055,8 @@ void AnimationPlayer::get_animation_list(List<StringName> *p_animations) const {
 }
 }
 
 
 void AnimationPlayer::set_blend_time(const StringName &p_animation1, const StringName &p_animation2, float p_time) {
 void AnimationPlayer::set_blend_time(const StringName &p_animation1, const StringName &p_animation2, float p_time) {
+	ERR_FAIL_COND(!animation_set.has(p_animation1));
+	ERR_FAIL_COND(!animation_set.has(p_animation2));
 	ERR_FAIL_COND_MSG(p_time < 0, "Blend time cannot be smaller than 0.");
 	ERR_FAIL_COND_MSG(p_time < 0, "Blend time cannot be smaller than 0.");
 
 
 	BlendKey bk;
 	BlendKey bk;