How to access the "material layer" at runtime

Question is about the how to access at runtime. (i’m currently using version 4.20.)

  1. How to access layer parameters at runtime.
  • The current code can not be accessed as below.

FMaterialParameterInfo ParameterInfo(ParameterName);
// @TODO: This will only work for non-layered parameters

  • Should I access ParameterInfo by modifying it with EMaterialParameterAssociation :: LayerParameter?
  • Or is there another way to access the runtime via BP?
  1. How to toggle a layer at runtime
  • This part was not found in both code and BP.
  1. How to make a cache for all cases
  • If can toggle at runtime, the engine will take care of the cache for all cases?