Bake LightingMap for mutliple objects at different resolution with one render call
I'm having a problem where textures come out stretched/shrunk vertically, when I try to bake LightingMap for multiple objects at once, when the output size is set differently on each object. I do this by selecting all the object and calling:
I set the output size by doing this:
map = LightingMap()
map.outputSzX = size
map.outputSzY = size
obj.INodeBakeProperties.activeWidth = size
obj.INodeBakeProperties.activeHeight = size
where [size] changes from one object to another.
The problem is that the renderer seems to internally always use either the global render settings height, or the one passed into the "render" call via the outputHeight: named argument, and then squishes the texture back into a square that fits into my [size] value. So for instance, if I set size to 256, and call render with outputHeight:512, the output image file will have actual size of 256x256, but the lightmap information will be squished vertically into the upper half of the image.
Obviously, the solution is to always pass in outputWidth: and outputHeight: arguments matching the outputSzX and outputSzY on the LightingMap, but that's impossible to do when you select multiple objects and render them in one go, and want to have the lightmap size different for each object.
The reason why I really want to render multiple objects at once, rather than each one individually, is that I found out the complete job takes up to 10 times less time (I assume that's because the renderer can reuse some persistent state, that gets discarded when you restart the renderer). Does anyone know of a way to get around this bug?