Code to make AO with no UI

Code to make AO with no UI

Madeira3d
Enthusiast Enthusiast
446 Views
2 Replies
Message 1 of 3

Code to make AO with no UI

Madeira3d
Enthusiast
Enthusiast

Hi ,

I need to save screen real estate and the baking takes up to much room and I would like to assign the AO with a distance of x to a quick python script.

Can someone help me with a sample? I'm not a Python programmer but I think I can understand the code enough to change it for my needs.

 

Can someone help please?

Thank you 

Sergio

0 Likes
Accepted solutions (1)
447 Views
2 Replies
Replies (2)
Message 2 of 3

Madeira3d
Enthusiast
Enthusiast
Accepted solution

Hi ,

 

A co-worker helped me with the code, in case you are interested here it goes:

 

Can someone from AD add a enhancement request to add the bake Weighting Cosine available also via the API?

Thanks

 

computeAmbientOcclusion(quality=4, minDistance=1, maxDistance=3000, indirectIllumination=True, colorBleeding=True, gatherQuality=4, numIndirections=2, subdivide=False, minEdgeLength=1, overrideMaterialColor=False, materialColorR=0.7, materialColorG=0.7, materialColorB=0.7, subdivisionQuality=1, intensityThreshold=0.05)

0 Likes
Message 3 of 3

sinje_thiedemann
Autodesk
Autodesk

Hi, I've added your request to make the weighting option for vertex baking available in Python.

 

For texture baking, (vrBakeService.bakeToTexture), the option can be set:

illumSettings = vrdIlluminationBakeSettings()
illumSettings.setAmbientOcclusionWeight(vrBakeTypes.AmbientOcclusionWeight.Cosine)
#...etc
texSettings = vrdTextureBakeSettings()
texSettings.setSamples(128)
texSettings.setUseDenoising(True)
#...etc
vrBakeService.bakeToTexture(geoNodes, illumSettings, texSettings)

 

0 Likes