Is it impossible to change a material within the Construction Script?

I’m nearly finished with a blueprint that I can use to select different sorts of trees I made and swap variants of meshes and color all within the editor. Figured out the mesh bit, but having trouble with the material portion.

Essentially I’m trying to tell the construction script to set the material of my leaves to one instance or another dependent on whether the exposed “Color Variant” INT variable is 1 or 2. I’ve set it up multiple ways and I can’t get it to actually work in the editor. Yet, during simulation I can use the INT slider and it DOES work.

So my question is, can a construction script just not change a material?

UPDATE: I knew I wasn’t crazy. It turns out I can do it, but I believe the problem was that the Construction Script couldn’t actually pull the materials out of a struct like I wanted it to. If someone has a “why” for that, I’d love to know. Until then, I suppose I’ll need to find another workaround.

New update. My assumption was incorrect, and I can still pull those material instance values from a struct. However, what I did find was that I was trying to pull what struct to use based on an enum value found in the gamemode blueprint. So I suppose the editor can’t read what that is unless the game is active, and that’s what the real issue was.

So I need to find a way to have it read that value while in the editor.

All right. My workaround for this was to make a variable for my trees that copies the value from the gamemode on BeginPlay, this way in the editor my trees work based on this now local enumeration and can use it to pull the material instance values. Then I built an editor utility widget that allows me to set the same local enum value for all trees in the present level to whatever value I desire so that I can preview the trees for each season.