Crash when replacing static mesh with LOD, with itself

I am experiencing the exact same crash…I have to remove LODs on the static mesh I want to replace, replace all selected actors with a new BP, and then re-create the LODs.

This is a really frustrating bug…

I’ve encountered a bug which causes the editor to crash. It seems to occur when you replace a static mesh that has LODs with itself via the right click menu in the editor (Replace selected actors with) - this includes replacing a static mesh with a blueprint made front the static mesh, or vice versa.

Reproduction can require a few steps to replicate, but the conditions occur fairly commonly during normal work in the editor - such as creating a prefab blueprint for static meshes already placed in the level. It took a while to figure out exactly what was causing it to crash, but I appear to have narrowed down the cause.

In order to reproduce the crash, first you must have a mesh with 1 or more LOD levels beyond the base.

Place the object, build lighting, save, restart the editor, and then attempt to replace it. This should cause the crash. Simply placing and attempting to replace the object will most likely not be sufficient to cause the crash.

Moving the object before replacing it will not prevent the crash, however, replacing the object with a different static mesh or duplicating the object and then replacing it will not cause the crash.

  • This appears to happen regardless of project, migrating the assets to a new project will not solve the issue.
  • LODs were generated using UE4’s built in LOD generation.
  • Deleting the LODs seems to solve the issue, even after rebuilding lighting, saving, and reloading.

For reference, this was in the crash report:

Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\Build++UE4+Release-4.16+Compile\Sync\Engine\Source\Runtime\Core\Public\Containers/Array.h] [Line: 633]
Array index out of bounds: 1 from an array of size 1