瀏覽代碼

Use the blend parameter passed to blend_animation during graph processing

muiroc 5 年之前
父節點
當前提交
01bd1b33c7
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      scene/animation/animation_tree.cpp

+ 2 - 1
scene/animation/animation_tree.cpp

@@ -820,6 +820,7 @@ void AnimationTree::_process_graph(float p_delta) {
 			Ref<Animation> a = as.animation;
 			float time = as.time;
 			float delta = as.delta;
+			float weight = as.blend;
 			bool seeked = as.seeked;
 
 			for (int i = 0; i < a->get_track_count(); i++) {
@@ -839,7 +840,7 @@ void AnimationTree::_process_graph(float p_delta) {
 
 				ERR_CONTINUE(blend_idx < 0 || blend_idx >= state.track_count);
 
-				float blend = (*as.track_blends)[blend_idx];
+				float blend = (*as.track_blends)[blend_idx] * weight;
 
 				if (blend < CMP_EPSILON) {
 					continue; //nothing to blend