I don’t understand the parameters SetMaterialUsage takes. I’m using Instanced static meshes so I need to toggle the “Use with Instanced Static Meshes” toggle so that my materials render on the instances. I’m trying to do this in code and not through the editor.
SetMaterialUsage(true, MATUSAGE_InstancedStaticMeshes, false); This gives me red line under the first parameter. Error says “initial value of reference to non-const must be an lvalue”. What does this mean and how can I set this first parameter correctly?
The bNeedsRecompile parameter is a function output that’s there to inform you whether the material was recompiled when the usage changed. I don’t believe bSkipPrim actually does anything and you can ignore it.