Turning viewport Ambient Occlusion on/off

Hi everybody!

Is there a way to toggle the viewport Ambient Occlusion on and off (use_ssao) from a script?

Hi

If you look at http://www.blender.org/api/blender_python_api_2_76_1/bpy.types.GPUFXSettings.html#bpy.types.GPUFXSettings.use_ssao , the link “Online Python Reference” takes you to, you will see the last line references

References
[TABLE=“class: hlist”]

[/TABLE]
which tells you its on the fx_settings of the space_data region of a view_3D space.

which will be



context.space_data.fx_settings.use_ssao = True


In code run from the view_3D area.

Otherwise


>>> C.screen.areas[3].type
'VIEW_3D'

>>> C.screen.areas[3].spaces.active.fx_settings.use_ssao
False


You nailed it batFINGER, it works like a charm… And thanks for the python reference pointers, sometimes i do get lost over there…