Setting new materials on USDStageActor

I’m trying to change materials at run time for a USD model loaded into a USDStageActor.

I’m using GetGeneratedComponent, casting to a StaticMeshComponent and then assigning the new material to the correct slot. The new material is from the Twinmotion pack of materials.

The weird thing is… It only works on North/South facing faces. For any East/West face I get the wrong result.

Here’s my imported USD file - a simple building with four outside walls. The brick material used is provided in the USD file itself:

image

And here’s what it looks like after I update all four walls to use the new brick material:
image

Help!? Any ideas?

1 Like

Does it work in editor? If you open the stage actor and replace the material, or does it give same result?

Hi @UE_FlavienP - It gives the same result in the editor… (I can’t believe I didn’t try that already!)

The above image shows the USDA model with two outside walls both with Material Slot 4 set to MI_BrickClean03 material. One face is working properly, the other face (facing out in this orientation) is glitched.

I’m using a locally compiled version of UE 5.2.1 with the only edit being to add FORCE_ANSI_ALLOCATOR=1 (per the instructions)

Thanks.

Do not know how the TM material works but probably something about wrong UVs on that wall.

Thanks for the tip - I’ll investigate.

Yes, that was the problem. The model had bad normals for the East/West walls.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.