FBX import crashes UE 5.5 when polygons have unassigned material

Hello,
the new FBX importer introduced in 5.5 crashes the editor when importing a static mesh that has multiple materials → this happens if some polygons have unassigned materials.

Here I imported a Mesh with 4 Materials, but i have missed some polygons which had no materials. The moment you press import, the editor crashes. This is what the crash reporter spits out:

Assertion failed: (Index >=0) & (Index < ArrayNum) [File:D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Containers\Array.h] [Line: 783]
Array index out of bounds: -1 into an array of size 4

Of course its not good if there is an unassigned material. A warning would be nice. If i remember correctly the old importer just made a new material…not sure. I would prefer a warning tbh. Took me quite a while to figure out what the cause of the crashes were. The array index out of bounds in the error report changes depending on the amount of material slots.

YES. This is happening. and happened in 5.4 IRC. I had to change my entire workflow to USD to get around this.

How this is not being fixed is beyond me . cmon epic.

@seersense
Can you share the fbx sample with us?
Which software did you use to create such FBX.

you can try to deactivate the interchange FBX importer to go through legacy instead

Interchange.FeatureFlags.Import.FBX false

Hello @UE_FlavienP

I am surprised this is news. I kind of like that is checking my assets, although in a very cruel manner. I create most assets in Cinema4D. I export stuff manually.

I give you a simplified FBX to test it. A cube with only one material, but one polygon left out with no material. It will crash. have tried on 3 machines on different projects. good luck :slight_smile:

UE_FBX Importer_CausesCrash.fbx (22.1 KB)

UPDATE: Additional Cause

I also found a second way the importer is crashing:

When you have more than 1 material on your mesh, lets say 3 and for instance the second material does not have UV projection but something else like Spherical projection, then at the import stage it crashes. the be more exact, I think it crashes when it has to generate a uv set set for a material slot. the fbx file however is fine in itself and i can open it in other software.
Legacy importer did the following: it imported the materials in order, once it hit another projection method it then created a UV for that from that projection, but then skipped rest of the materials, and then you only ended up with 2 material slots instead of 3.

Here is an example
All Polys have a material assigned. 3 Materials, the second one is set to spherical mapping instead of UV. Again, it will crash. handle with care.

UE_FBX Importer_CausesCrash_3Mats_1Spherical.fbx (27.7 KB)

I also deactivated stuff like material search, most settings are basic, i just have force X Front axis. If you need the specifics I send you. But its not that, i’m sure