- Home /
Editing Lightmaps At Edit Time
Hi all,
I've written an editor script which edits one of the beast lightmaps, colouring an object red in the lightmap.
To colour the object it uses:
LightmapSettings.lightmaps[lightmapIndex].lightmapFar.SetPixel((int)x, (int)y, Color.red);
Then applies the texture with:
LightmapSettings.lightmaps[lightmapIndex].lightmapFar.Apply();
This works great, the object is now red and in the lightmap preview it's clearly red too.
However as soon as I hit save, the lightmap reverts to how it was baked by Beast. Any idea on how I commit these changes onto the actual .exr file in Unity?
Answer by ilya_ca · Feb 22, 2013 at 12:20 PM
It turns out, that Unity can only import EXR files, it cannot save changes made to them. You should look for an external imaging library that allows to import/export EXR.
Your answer
![](https://koobas.hobune.stream/wayback/20220613063828im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Beast Lightmapping Artifacts 2 Answers
Lightmapping progress (Editor Script) 0 Answers
Beast Lightmapping issue 1 Answer
Lightmapping problem, squares appearing on imported model. 1 Answer
Lightmapping a closed indoor area? 2 Answers