Execute c++ only during lightmass generation

My goal is to instantiate static mesh instance components and have these components evaluated as part of lightmass generation. Performing this during the OnConstruction function did not result in the instances getting baked.

So starting from the basics. Is there an entry point, function, or conditional that would allow me to execute code only during lightmass generation?

Hi Danieru,

Lighting cannot be built at runtime. You will need to use the build settings in the editor when you want to bake any lighting.

Thank you!

Tim

Yes of course, but the documentation I read implied the lightmass generation swarm ran the construction scripts. Otherwise there would be no way to bake static meshes generated from these scripts.

Do you mind linking to the documentation and I can take a look.