Community
VRED Forum
Welcome to Autodesk’s VRED Forums. Share your knowledge, ask questions, and explore popular VRED topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bake Light and Shadows with python

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
mfontan9
61 Views, 2 Replies

Bake Light and Shadows with python

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:

 

the settings intended...the settings intended...

 

Thank you for your help.

Labels (2)
2 REPLIES 2
Message 2 of 3
michael_nikelsky
in reply to: mfontan9

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.



Michael Nikelsky
Sr. Principal Engineer
Message 3 of 3
mfontan9
in reply to: michael_nikelsky

Alright, it's confusing, but you saved my day!
Thank you @michael_nikelsky !

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report