I am trying to access the world shading settings in python.
I want to enable ambient occlusion and give it a value of
I have tried:
But I didn't work.
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
To turn Ambient Occlusion on you must set its value to
True. What you are doing wrong is that you are trying to execute the function
use_ambient_occlusion() which does not exist because it's variable not a function.
import bpy bpy.context.scene.world.light_settings.use_ambient_occlusion = True # turn AO on bpy.context.scene.world.light_settings.ao_factor = 0.5 # set it to 0.5