Ensure Condition Failed during static mesh build or import

I have a problem importing a mesh, well it imports but this error keeps popping up! To my understanding during the static mesh build… What could be the cause and what is the fix for this type of errors? Engine doesn’t crash btw.

Here is the error message that pops up:
LogOutputDevice:

Error: === Handled ensure: ===
LogOutputDevice: Error: Ensure condition failed: !Result->ContainsNaN() [File:D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Math\UnrealMathSSE.cpp] [Line: 49]
LogOutputDevice: Error: Stack:
LogOutputDevice: Error: [Callstack] 0x00007ffa0eef49b8 UnrealEditor-Core.dll!VectorMatrixMultiply() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Math\UnrealMathSSE.cpp:49]
LogOutputDevice: Error: [Callstack] 0x00007ffa0523ee0e UnrealEditor-StaticMeshDescription.dll!GetTriangleTangentsAndNormals() [D:\build++UE5\Sync\Engine\Source\Runtime\StaticMeshDescription\Private\StaticMeshOperations.cpp:217]
LogOutputDevice: Error: [Callstack] 0x00007ffa0521dde6 UnrealEditor-StaticMeshDescription.dll!<lambda_10f87e5b9e22f72a909fa42d4b6a7683>::operator()() [D:\build++UE5\Sync\Engine\Source\Runtime\StaticMeshDescription\Private\StaticMeshOperations.cpp:300]
LogOutputDevice: Error: [Callstack] 0x00007ffa05222079 UnrealEditor-StaticMeshDescription.dll!ParallelForImpl::NewParallelForInternal<TFunctionRef<void __cdecl(int)>,<lambda_600b85aa2a81f4761389a82b02631227>,std::nullptr_t>'::2’::FParallelExecutor::operator()() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\ParallelFor.h:566]
LogOutputDevice: Error: [Callstack] 0x00007ffa0522a7f1 UnrealEditor-StaticMeshDescription.dll!LowLevelTasks::TTaskDelegate<void __cdecl(bool),48>::TTaskDelegateImpl<<lambda_a7d909f875cf8fde887b62459e73acd4>,0>::CallAndMove() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\Fundamental\TaskDelegate.h:171]
LogOutputDevice: Error: [Callstack] 0x00007ffa0ec6e398 UnrealEditor-Core.dll!LowLevelTasks::FTask::ExecuteTask() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\Fundamental\Task.h:426]
LogOutputDevice: Error: [Callstack] 0x00007ffa0ec52a78 UnrealEditor-Core.dll!LowLevelTasks::FScheduler::TryExecuteTaskFrom<&LowLevelTasks::TLocalQueueRegistry<1024>::TLocalQueue::DequeueGlobal,0>() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\Fundamental\Scheduler.cpp:280]
LogOutputDevice: Error: [Callstack] 0x00007ffa0ec8ea02 UnrealEditor-Core.dll!LowLevelTasks::FScheduler::WorkerMain() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\Fundamental\Scheduler.cpp:320]
LogOutputDevice: Error: [Callstack] 0x00007ffa0ec5f4d0 UnrealEditor-Core.dll!UE::Core::Private::Function::TFunctionRefCaller<<lambda_776551d1e343b6cb7eaf0e5521c77c81>,void __cdecl(void)>::Call() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Templates\Function.h:549]
LogOutputDevice: Error: [Callstack] 0x00007ffa0edc3d25 UnrealEditor-Core.dll!FThreadImpl::Run() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\HAL\Thread.cpp:69]
LogOutputDevice: Error: [Callstack] 0x00007ffa0f3583ab UnrealEditor-Core.dll!FRunnableThreadWin::Run() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:146]
LogOutputDevice: Error: [Callstack] 0x00007ffa0f3513b0 UnrealEditor-Core.dll!FRunnableThreadWin::GuardedRun() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:76]
LogOutputDevice: Error: [Callstack] 0x00007ffab1487034 KERNEL32.DLL!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffab3002651 ntdll.dll!UnknownFunction []

Hello impostekno and thank you for posting.

The error itself may signify there are broken nodes in your project. As mentioned by HeavensDisciples, they checked through all of the materials and blueprints and found a few broken nodes needing to be fixed.

I hope this assists you in addressing the error.

1 Like

Thanks for your response Pollte_Muon,

I will look into this asap.

What bothers me is that this happens during import of the fbx file (specifically build/triangulation of meshes). There are many other similar fbxs that go through the same process and they don’t have this kind of issue. So it kind of makes me think that it might have to do something with the fbx itself but I couldn’t find any issues there yet.

Did you ever solve? I have same issue.

// UV density is not supported to be generated at runtime for now. We fake that it has been initialized so that we don’t trigger ensures.
StaticMesh->GetStaticMaterials()[MaterialSlotIndex].UVChannelData = FMeshUVChannelInfo(1.f);

in interchangestaticmeshfactory

Sorry for the late answer, but for anyone that might have this issue as well, here are some solutions I have used:

:one: Fix geometry (NaNs, degenerate faces, zero-length normals).
:two: Ensure correct export settings (Normals & Tangents) - export from 3D software.
:three: Disable Unreal auto-calculations if needed.
:four: Clear cache & restart Unreal before re-importing.

In my case it was due to the wrong mesh configuration inside the 3D software when one of the modelers made the mesh. Also importing logic had build mesh settings logic run by a py script that had this code:

settings = unreal.MeshBuildSettings()
settings.recompute_normals = False
settings.use_high_precision_tangent_basis = True

In conclusion, the imported mesh may contain extra parts that were incorrectly exported due to incorrect normals or unexpected geometry issues. These problematic elements can cause Unreal’s import calculations to fail. Fortunately, Unreal provides specific warnings or error messages for the meshes that fail to build. By checking the log output, I was able to identify the exact problematic meshes across multiple models.