A small scene component that toggles the D_ALLOW_FOLIAGE render attribute combo from a Foliage property each update. Runs in the editor as well as at runtime.
public class EnableFoliage : Component, Component.ExecuteInEditor {
[Property] public bool Foliage {get; set;}
protected override void OnUpdate() {
Scene.RenderAttributes.SetCombo("D_ALLOW_FOLIAGE", Foliage);
base.OnUpdate();
}
}