How can I generate lightmap UVs and change Lightmap Coordinate Index for multiple assets at once?

I am currently working on baked lighting for some environments. The assets in these environments require me to generate lightmap UVs and subsequently change the lightmap coordiante index to 1.

However some of my environments have 1000s of assets so this will take far too long to do manually.

I have already tried editing in property matrix but neither of these two settings show up in them.

Any help would be much appreciated.

If you are familiar with Blueprints or Python you can script a utility to batch through your assets, turn on lightmap UVs, and save them.

For example in Blueprint:

Create an Editor Utility Blueprint.

Choose Asset Action Utility as the class.

Create a function, call it something like “Generate Lightmap UVs”.

In the function, create a loop for selected assets to edit their Build Settings.

Beware that the “Make MeshBuildSettings” node has default values for all the attributes, and you will want to make sure they are the same as what is currently in your assets, with the exception of the LIghtmap UVs being turned on.

To use this function, select all the assets you want to edit in the content drawer, right click, and go to “Scripted Asset Actions”, and select your function.