From 619c1e506e1b4f12f40e4e8a1b7d7beecec3745c Mon Sep 17 00:00:00 2001 From: Mark Riedesel Date: Tue, 9 Nov 2021 09:30:58 -0500 Subject: [PATCH] Fix glTF cubic spline track interpolation incorrectly reporting times/values size mismatch (3.4 specific) (cherry picked from commit 999bba6916ea7f1fe1d6d968e23b07aae054f8b5) --- modules/gltf/gltf_document.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index 430105a6232..dc6770270d7 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -5770,7 +5770,7 @@ struct EditorSceneImporterGLTFInterpolate { template T GLTFDocument::_interpolate_track(const Vector &p_times, const Vector &p_values, const float p_time, const GLTFAnimation::Interpolation p_interp) { ERR_FAIL_COND_V(!p_values.size(), T()); - if (p_times.size() != p_values.size()) { + if (p_times.size() != (p_values.size() / (p_interp == GLTFAnimation::INTERP_CUBIC_SPLINE ? 3 : 1))) { ERR_PRINT_ONCE("The interpolated values are not corresponding to its times."); return p_values[0]; }