Create C++ script to scan all materials for FMOD material expression node? (4.27)

I’ve been living with the editor crashing error below for quite a while… seemingly, somewhere within the 3k materials in my project, I’ve got a FMOD node with a divisor that can be 0, which is causing this error to be thrown up. I’ve looked at all the materials I thought might be responsible and can’t find it.

I tried to write a python script to scan the asset registry for materials and it did successfully loop through all the materials in the project but gave me an error each time about the material expressions not being readable… it seems like this is something that could be done in C++ but that’s not my area of expertise.

Can anyone help or point me in the right direction?

=== Handled ensure: ===
LogOutputDevice: Error: Ensure condition failed: Y != 0 [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Core/Private/GenericPlatform/GenericPlatformMath.cpp] [Line: 108]
LogOutputDevice: Error: FMath::FMod(X=0.000000, Y=0.000000) : Y is zero, this is invalid and would result in NaN!

1 Like

Want to add this error seems to show during editor startup and I have checked all blueprints for any of the modulo functions (Percent_floatfloat, Percent_intint, etc) so it’s almost certainly buried in a material or material function somewhere.

Debugging startup in VS hits a breakpoint here:

[Inline Frame] UE4Editor-Core.dll!FGenericPlatformMath::FmodReportError::__l5::<lambda_c6982cf0e5829f672f7bfdaf5139595e>::operator()() Line 108 C++