def set_up_scene_shading(self):
    bpy.context.scene.world.use_nodes = True
    tree = bpy.context.scene.world.node_tree
    links = tree.links
    for node in tree.nodes.values():
        tree.nodes.remove(node)
    out_node = tree.nodes.new(type='ShaderNodeOutputWorld')
    out_node.location = (1100, 0)
    mix_node = tree.nodes.new(type='ShaderNodeMixShader')
    mix_node.location = (900, 0)
    lightpath_node = tree.nodes.new(type='ShaderNodeLightPath')
    lightpath_node.location = (700, 350)
    self.ambient_node = tree.nodes.new(type='ShaderNodeBackground')
    self.ambient_node.inputs['Color'].default_value = (0.0, 0.0, 0.0, 1.0)
    self.ambient_node.location = (700, 0)
    self.bg_node = tree.nodes.new(type='ShaderNodeBackground')
    self.bg_node.inputs['Color'].default_value = (0.0, 0.0, 0.0, 1.0)
    self.bg_node.location = (700, (- 120))
    links.new(lightpath_node.outputs.get('Is Camera Ray'), mix_node.inputs.get('Fac'))
    links.new(self.ambient_node.outputs.get('Background'), mix_node.inputs[1])
    links.new(self.bg_node.outputs.get('Background'), mix_node.inputs[2])
    links.new(mix_node.outputs.get('Shader'), out_node.inputs.get('Surface'))
    coord_node = tree.nodes.new(type='ShaderNodeTexCoord')
    self.bg_mapping_node = tree.nodes.new(type='ShaderNodeMapping')
    self.bg_mapping_node.location = (200, 200)
    self.bg_hdri_node = tree.nodes.new(type='ShaderNodeTexEnvironment')
    self.bg_hdri_node.location = (400, 200)
    links.new(coord_node.outputs.get('Generated'), self.bg_mapping_node.inputs.get('Vector'))
    links.new(self.bg_mapping_node.outputs.get('Vector'), self.bg_hdri_node.inputs.get('Vector'))
    self.illum_mapping_node = tree.nodes.new(type='ShaderNodeMapping')
    self.illum_mapping_node.location = (200, (- 200))
    self.ambient_hdri_node = tree.nodes.new(type='ShaderNodeTexEnvironment')
    self.ambient_hdri_node.location = (400, (- 200))
    links.new(coord_node.outputs.get('Generated'), self.illum_mapping_node.inputs.get('Vector'))
    links.new(self.illum_mapping_node.outputs.get('Vector'), self.ambient_hdri_node.inputs.get('Vector'))
def set_up_scene_shading(self):
    bpy.context.scene.world.use_nodes = True
    tree = bpy.context.scene.world.node_tree
    links = tree.links
    for node in tree.nodes.values():
        tree.nodes.remove(node)
    out_node = tree.nodes.new(type='ShaderNodeOutputWorld')
    out_node.location = (1100, 0)
    mix_node = tree.nodes.new(type='ShaderNodeMixShader')
    mix_node.location = (900, 0)
    lightpath_node = tree.nodes.new(type='ShaderNodeLightPath')
    lightpath_node.location = (700, 350)
    self.ambient_node = tree.nodes.new(type='ShaderNodeBackground')
    self.ambient_node.inputs['Color'].default_value = (0.0, 0.0, 0.0, 1.0)
    self.ambient_node.location = (700, 0)
    self.bg_node = tree.nodes.new(type='ShaderNodeBackground')
    self.bg_node.inputs['Color'].default_value = (0.0, 0.0, 0.0, 1.0)
    self.bg_node.location = (700, (- 120))
    links.new(lightpath_node.outputs.get('Is Camera Ray'), mix_node.inputs.get('Fac'))
    links.new(self.ambient_node.outputs.get('Background'), mix_node.inputs[1])
    links.new(self.bg_node.outputs.get('Background'), mix_node.inputs[2])
    links.new(mix_node.outputs.get('Shader'), out_node.inputs.get('Surface'))
    coord_node = tree.nodes.new(type='ShaderNodeTexCoord')
    self.bg_mapping_node = tree.nodes.new(type='ShaderNodeMapping')
    self.bg_mapping_node.location = (200, 200)
    self.bg_hdri_node = tree.nodes.new(type='ShaderNodeTexEnvironment')
    self.bg_hdri_node.location = (400, 200)
    links.new(coord_node.outputs.get('Generated'), self.bg_mapping_node.inputs.get('Vector'))
    links.new(self.bg_mapping_node.outputs.get('Vector'), self.bg_hdri_node.inputs.get('Vector'))
    self.illum_mapping_node = tree.nodes.new(type='ShaderNodeMapping')
    self.illum_mapping_node.location = (200, (- 200))
    self.ambient_hdri_node = tree.nodes.new(type='ShaderNodeTexEnvironment')
    self.ambient_hdri_node.location = (400, (- 200))
    links.new(coord_node.outputs.get('Generated'), self.illum_mapping_node.inputs.get('Vector'))
    links.new(self.illum_mapping_node.outputs.get('Vector'), self.ambient_hdri_node.inputs.get('Vector'))