Vray Multi Bake Textures

Hi all,

Me and my friend are trying to find a way to bake multiple texture with vray in blender,
after some help we use this script:


import bpy

sce = bpy.context.scene

Enable autosave

sce.vray.exporter.auto_save_render = True
sce.vray.SettingsOutput.img_dir = “//bake/”

Enable Bake

sce.vray.VRayBake.use = True

Manual object list:

ob = [‘cube’,‘plane’]

for ob in objects:

Selection

for ob in bpy.context.selected_objects:
sce.vray.VRayBake.bake_node = ob.name
sce.vray.SettingsOutput.img_file = “bake_%s”%(ob.name)

bpy.ops.vray.render()

the problem is vray opens 2 windows to bake, but renders 2 times only the 1st object (cube).

it’s possible to fix?
thank you in advance!