Skip to main content
1 of 2
Dale Cieslak
  • 2.8k
  • 16
  • 16

Try this:

import bpy

sky_texture = bpy.context.scene.world.node_tree.nodes.new("ShaderNodeTexSky")
bg = bpy.context.scene.world.node_tree.nodes["Background"]
bpy.context.scene.world.node_tree.links.new(bg.inputs["Color"], sky_texture.outputs["Color"])
Dale Cieslak
  • 2.8k
  • 16
  • 16