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)?