Activate 'Generate Lightmap UV' for all my Assets automatically?


Is there a way to activate the ‘Generate Lightmap UV’ in the FBX importer for all my Assets at once (I have hundreds of Assets to change…)?
Could a script change this option automatically?

Thx :wink:

Create an editor script containing this:

using UnityEditor;

public class FBXScaleFix : AssetPostprocessor
    public void OnPreprocessModel()
        ModelImporter modelImporter = (ModelImporter) assetImporter;
  	    modelImporter.generateSecondaryUV = true;

and place it in your “Editor” folder within your project directory. Then reimport all your assets. They should now have “Generate Lightmap UVs” option enabled.