WPO validation in headless builds

In order to improve performance and workflows, we are implementing a custom data validator class (inheriting form UEditorValidatorBase) to ensure that meshes using materials with World Position Offset have Shadow Cache Invalidation Behaviour set to Rigid. We are running into one main issue.

- Since most of our materials are complex and use multiple layers - to check if the material uses WPO, we get the material resource and check the return value of the function MaterialUsesWorldPositionOffset_GameThread(). However, in headless builds (for example when you run Data Validation) the material resource is null and therefore the function always returns false.

- Although there is a way to check if the base material outputs to the WPO pin, I was unable to find a straightforward way to check if the material layers are outputting any WPO data, and I would like to avoid iterating over every layer in a material.

My question is:

What is the best way to check if a material uses World Position Offset, that is compatible with a headless build (such as when you run Data Validation)?

Hello!

I think that problem would be related to the fact the commandlet is using the NullRHI rendering implementation. You can try running with -AllowCommandletRendering. This will initialize the graphic engine which should result in making the rendering data available. If you are running on a server without a dedicated GPU, you will need to also use -AllowSoftwareRendering .

Regards,

Martin

Hey Martin,

Thanks for your quick reply! That command worked in the headless build and my validator seems to be working as expected.

Warm regards,

Amritha