Hi all,
I would like to bake the Ambient Occlusion to vertices with python, I probably missing something cause once I execute it, it just erases my previous Ambient Occlusion and keep it blank.
the code:
def bakeAO():
node_ptrs = vrNodeService.getSelectedNodes()
# illuminationBakeSettings
illuminationBakeSetting_ptr = vrdIlluminationBakeSettings()
illuminationBakeSetting_ptr.setAmbientOcclusionMaximumDistance(3000.0)
illuminationBakeSetting_ptr.setAmbientOcclusionMinimumDistance(1.0)
illuminationBakeSetting_ptr.setAmbientOcclusionWeight(vrBakeTypes.AmbientOcclusionWeight.Uniform)
illuminationBakeSetting_ptr.setColorBleeding(False)
illuminationBakeSetting_ptr.setDirectIlluminationMode(vrBakeTypes.DirectIlluminationMode.AmbientOcclusion)
illuminationBakeSetting_ptr.setIndirectIllumination(False)
# textureBakeSettings
textureSetting_ptr = vrdTextureBakeSettings()
vrBakeService.bakeToTexture(node_ptrs, illuminationBakeSetting_ptr, textureSetting_ptr, replaceTextureBake=True)
bakeAO()
the default settings I tried to reproduce:
Thank you for your help.
Solved! Go to Solution.
Solved by michael_nikelsky. Go to Solution.
The old vertex baking is currently not exposed in the new python API, you will have to use the vrAmbientOcclusion Module of the Python V1 API. The BakeService currently is only for texture baking.
Can't find what you're looking for? Ask the community or share your knowledge.