How to change strength of studio light via python? (UPBGE)

Hello I would like to have the studio light strength change from 1 to 0 when entering a new scene. I assume that this is achievable via python, but what would the required script be? Thanks.
s

Right click on Strength and choose Copy Full Path. Now you have the python code to change the strength :slight_smile: just take whatever that code is and toss an = 0 on the end

1 Like

Hello. I see, but how do I unlock this? Thanks

ss

Technically it’s bpy.data.screens["Layout"].shading.studiolight_intensity but it doesn’t really work, and given that this only shows in Material Preview, not Rendered, I don’t think you can use it

1 Like

I see. Are there any workarounds for this to darken the environment? For example changing the HDRI via python?

Yeah, that’s pretty simple :slight_smile:
bpy.data.worlds["World"].node_tree.nodes["Background"].inputs[1].default_value = 0

1 Like

thanks for the help

1 Like