How to get/set a material on a StaticMesh LOD in Unrealscript?

Using these functions on StaticMeshComponent:

native function MaterialInterface GetMaterial(int ElementIndex);

and

native virtual function SetMaterial(int ElementIndex, MaterialInterface Material);

Only ever considers the LOD0 mesh.

Does anyone know a way to access subsequent LOD materials?

To explain why I need this: I have seasons in my game and I apply MIC to all trees when the game starts, then apply seasonal changes the MIC’s during gameplay. The final LOD of the tree is just a billboard, but after using SetMaterial() on the main mesh, applies that material to all LODs.

Without a way of updating LOD materials, the only way I can think is for two options:

  1. Package the billboard textures into the main tree textures.
  2. Include a single polygon in all LODs prior to the billboard mesh (with material element index 0) with the billboard material applied.

Both are not ideal.

I’m not sure I followed all of that. What’s MIC?

The way I did time-based changes in my game was by changing parameters in material instances. Could you set up a list of the material instances that need to change with the season, update a scalar parameter in those materials, and let the LODs just load like they usually do?

MIC == Material Instance Constant

I do currently use MIC’s to transition between seasons, but up until now i’ve had to package the billboards into the one material, because you can’t update which materials get used for lods (they just take whatever you apply when you SetMaterial()).

The trouble with what you suggest is that you can’t apply single MIC to say 1000’s of trees of the same type without applying it via unrealscript (as far as i know). And when you SetMaterial() on a static mesh, it applies said material to all LODs (even though you may want a billboard at material slot 0 on your LOD3 mesh).