def set_ambient_light(self, hdri_filepath=None, color=(0.0, 0.0, 0.0, 1.0), hdri_rotation=(0.0, 0.0, 0.0)):
    tree = bpy.context.scene.world.node_tree
    links = tree.links
    if (hdri_filepath is None):
        for link in self.ambient_node.inputs['Color'].links:
            links.remove(link)
        self.ambient_node.inputs['Color'].default_value = color
    else:
        links.new(self.ambient_hdri_node.outputs.get('Color'), self.ambient_node.inputs.get('Color'))
        self.ambient_hdri_node.image = bpy.data.images.load(hdri_filepath, check_existing=True)
        self.illum_mapping_node.inputs.get('Rotation').default_value = hdri_rotation
def set_ambient_light(self, hdri_filepath=None, color=(0.0, 0.0, 0.0, 1.0), hdri_rotation=(0.0, 0.0, 0.0)):
    tree = bpy.context.scene.world.node_tree
    links = tree.links
    if (hdri_filepath is None):
        for link in self.ambient_node.inputs['Color'].links:
            links.remove(link)
        self.ambient_node.inputs['Color'].default_value = color
    else:
        links.new(self.ambient_hdri_node.outputs.get('Color'), self.ambient_node.inputs.get('Color'))
        self.ambient_hdri_node.image = bpy.data.images.load(hdri_filepath, check_existing=True)
        self.illum_mapping_node.inputs.get('Rotation').default_value = hdri_rotation