瀏覽代碼

Merge pull request #51051 from V-Sekai/gltf-less-logs

In glTF2 animations, log spam less when running.
Rémi Verschelde 4 年之前
父節點
當前提交
7ab3e8aa20
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      modules/gltf/gltf_document.cpp

+ 4 - 1
modules/gltf/gltf_document.cpp

@@ -5531,7 +5531,10 @@ struct EditorSceneImporterGLTFInterpolate<Quaternion> {
 template <class T>
 T GLTFDocument::_interpolate_track(const Vector<float> &p_times, const Vector<T> &p_values, const float p_time, const GLTFAnimation::Interpolation p_interp) {
 	ERR_FAIL_COND_V(!p_values.size(), T());
-	ERR_FAIL_COND_V(p_times.size() != p_values.size(), p_values[0]);
+	if (p_times.size() != p_values.size()) {
+		ERR_PRINT_ONCE("The interpolated values are not corresponding to its times.");
+		return p_values[0];
+	}
 	//could use binary search, worth it?
 	int idx = -1;
 	for (int i = 0; i < p_times.size(); i++) {