1
$\begingroup$

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.

enter image description here

$\endgroup$

1 Answer 1

1
$\begingroup$

you can try this code here:

import bpy

space = None
for a in bpy.context.screen.areas:
    if a.type == "VIEW_3D":
        
        for s in a.spaces:
            s.shading.studiolight_intensity = 0.15203

just as a hint how you can "see" what the command is: open the console, change the strength and you see the command in the console ;)

enter image description here

$\endgroup$
4
  • $\begingroup$ Hello, when I connect this script to a keyboard sensor (e.g. press G to activate) and press P to run the game, when I press G it has no effect real-time, but shows the effect after pressing Esc and returning to the viewport. Is there a method for this working real-time? Thanks. $\endgroup$
    – Minato
    May 8, 2022 at 15:54
  • $\begingroup$ i think in game you would have to change the background color.....this is "just" viewport shading, not rendered result $\endgroup$
    – Chris
    May 8, 2022 at 15:58
  • $\begingroup$ Thanks for the help $\endgroup$
    – Minato
    May 8, 2022 at 23:11
  • $\begingroup$ You are welcome!! $\endgroup$
    – Chris
    May 9, 2022 at 4:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .