Nanite problem, "Invalid material" on mesh import via Datasmith

Hey all,

i have a very frustrating problem with nanite. I took my first deepdive into UE5 two weeks ago and i did not manage to get Nanite running correctly :frowning:

Everytime i rightclick on a Static Mesh in my Content Browser and enable Nanite i get the Warning " Invalid material [null] used on Nanite static mesh [Box255] - forcing default material instead."

This happens with every object i import from 3ds max via Datasmith.
When i create a Box in Unreal itself and check Nanite on it seems to work.

It really doesnt matter which kind of mesh i import, even with a small box this problem appears.

Can anybody help? Thank you all!

3 Likes

@Norda001 We are also experiencing this, historical C4D Datasmith imports are creating a very long list of similar warnings:

“Invalid material [null] used on Nanite static mesh [black_box_4] - forcing default material instead.”

Trying to find this particular culprit in the scene, there doesn’t appear to be any material missing. Quite often they are happily rendering.

Did you manage to find any resolution to this issue?

1 Like

Hello. Did you find a solution to this problem? I have the same mistakes.
Please let me know about any solutions.

1 Like

The problem is that you’re probably trying to set static mesh BEFORE setting material.

That’s what I had:

1 | FActorSpawnParameters Param; Param.Owner = this;
2 | ABaseGeometry* SpawnedFigure = _World->SpawnActor<ABaseGeometry>(Param);

3 | SpawnedFigure->MainMesh->SetStaticMesh(_BaseGeometryMesh);
4 | SpawnedFigure->SetMainMaterial(_ListOfMaterials[RandElem]);

Where ABaseGeometry is derrived class from AActor, MainMesh is a UStaticMeshComponent.

The solution is to initialize the material first and then create the model.
I mean, swap two bottom lines:

3 | SpawnedFigure->SetMainMaterial(_ListOfMaterials[RandElem]);
4 | SpawnedFigure->MainMesh->SetStaticMesh(_BaseGeometryMesh);

If your case is different, the solution is probably somewhat similar.