0
$\begingroup$

So I found at the very bottom of this page that Blender removed the old use_enviroment_light API from bpy.types.WorldLighting. I have some code that used this API as follows:

bpy.context.scene.world.light_settings.use_environment_light = True

I wonder how I can update this code to keep using environment light in my rendering?

$\endgroup$
0
$\begingroup$

The property use_environment_light was part of the settings for the world when the Blender Internal render engine was used. This render engine has been removed in Blender 2.80 and replaced by Eevee. Like Cycles, Eevee uses the nodes based system for the world settings. Enabling environment lighting isn't necessary, it's always on.

$\endgroup$
  • $\begingroup$ Thank you for answering! Is there a way to change the environment light intensity in Eevee? I guess it's pretty low by default since my rendered images look very dark for now. $\endgroup$ – Zhengyuan Dong Oct 8 at 20:37
  • $\begingroup$ @ZhengyuanDong Yes, it's the strength value in the world tab. $\endgroup$ – Robert Gützkow Oct 8 at 20:40
  • $\begingroup$ Do I change it using bpy.context.world.surface.strength = 3.0 for exmaple? $\endgroup$ – Zhengyuan Dong Oct 11 at 18:09
  • $\begingroup$ I cannot find the strength attribute under bpy.context.world. From the graphics interface I can tell that strength under world tab uses shader nodes. But how can I modify it in python code? I am new to Blender and would really appreciate it if you can help! $\endgroup$ – Zhengyuan Dong Oct 14 at 17:57
  • $\begingroup$ @ZhengyuanDong It's bpy.context.scene.world.node_tree.nodes['Background'].inputs['Strength'].default_value. $\endgroup$ – Robert Gützkow Oct 14 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.