[25.jun.2015 updated to version 0.9. Added an ambient occlusion mapper, map images can now be resized, reworked the “dynamic with colors” option for the lightmap]
I made a plugin to generate static lightmaps. After lots of experiments I found out that It kinda works and I plan to use it in my current game project. Someone else might find it useful so I’m posting it here.
Describing what it does is actually more complicated than what it actually does. Basically, it does (a lot less of) what TextureAtlas does then some. It takes all the selected objects (or all the meshes in the current layer if no object is selected), creates an uvlayer dedicated to the lightmap (if it doesn’t exists), it bakes the scene, assigns the image to a texture (if it has not already been created) then adds that texture to the materials of the selected objects (if it has not already been added).
It also changes the “emit” value of the materials (if the emit field in the Lightmapper panel is not -1), because (but I might be wrong here), unless you use nodes, if you want the lightmap to work decently with dynamic lights there must be some sort of overall ambient lighting.
In all this, the workflow is as follows:
create the scene with all the objects you want, adds all the lights you like, add the diffuse textures or multimaterials… whatever, as usual. Then you press the button and voilà, you should have your static lightmap built and applied. The lightmap image must then be saved somewhere manually if you want to actually keep it.
Once the map has been generated, it will be overwritten by subsequent calls of the operator, so one can make adjustments.
I actually didn’t tested it but it should be possible to create more than one lightmap in a scene, you just use a different name in the lightmapper “name” field and possibly select a different subset of objects before to press the button.
I’ve used it on large maps with lots of stuff and lights and it seems to work well.
I think there are no more bugs but never say never. I’m 99.9% positive that it shouldn’t work with objects that uses nodes for their materials.
Latest test video: