Explorar o código

Merge pull request #76257 from spanzeri/sdfcollision-popup-stuck

Fix editor lock on sdf collision bake on error
Rémi Verschelde %!s(int64=2) %!d(string=hai) anos
pai
achega
f6bb71fc77
Modificáronse 1 ficheiros con 7 adicións e 2 borrados
  1. 7 2
      scene/3d/gpu_particles_collision_3d.cpp

+ 7 - 2
scene/3d/gpu_particles_collision_3d.cpp

@@ -469,8 +469,13 @@ Ref<Image> GPUParticlesCollisionSDF3D::bake() {
 	}
 
 	//compute bvh
-
-	ERR_FAIL_COND_V_MSG(faces.size() <= 1, Ref<Image>(), "No faces detected during GPUParticlesCollisionSDF3D bake. Check whether there are visible meshes matching the bake mask within its extents.");
+	if (faces.size() <= 1) {
+		ERR_PRINT("No faces detected during GPUParticlesCollisionSDF3D bake. Check whether there are visible meshes matching the bake mask within its extents.");
+		if (bake_end_function) {
+			bake_end_function();
+		}
+		return Ref<Image>();
+	}
 
 	LocalVector<FacePos> face_pos;