Python 2.8 - eliminating shadow by adding emission shader to background plane/image In Blender 2.8, I have an image/plane ("sky") serving as a background that shows an unwanted shadow from an object in the foreground.  Manually, I can eliminate the unwanted shadow on the background 'Sky' by changing the "Diffuse BSDF" shader to "Emission."

I would like to do this in Python, but my code doesn't produce the desired result.  Instead, the entire background image goes either gray or purple depending on which lines are executing.  I have noted where the code starts to create unwanted results.

Any suggestions would be much appreciated.  Thanks in advance!

bpy.ops.object.select_all(action='DESELECT')
bpy.data.objects['Sky'].select_set(True)
obj=bpy.data.objects['Sky']
skymaterial = bpy.data.materials.new('SkyMat')
obj.active_material = skymaterial  #UNWANTED RESULTS START HERE
skymaterial.use_nodes = True
nodes = skymaterial.node_tree.nodes
nodes.clear()
node_emission = nodes.new(type='ShaderNodeEmission')
I suggest that you learn how to do this manually first.

To create any material you will need a material output and link the emissive shader to that.
Use the Shader Editor to review your result.

import bpy

bpy.ops.object.select_all(action='DESELECT')
bpy.data.objects['Sky'].select_set(True)

obj = bpy.data.objects['Sky']

skymaterial = bpy.data.materials.new('SkyMat')
obj.active_material = skymaterial  #UNWANTED RESULTS START HERE
skymaterial.use_nodes = True
nodes = skymaterial.node_tree.nodes
nodes.clear()


# Create needed Nodes
nodeOut = nodes.new(type='ShaderNodeOutputMaterial')
nodeEmission = nodes.new(type='ShaderNodeEmission')
nodeTexture = nodes.new(type='ShaderNodeTexImage')


# Link them together
links = skymaterial.node_tree.links
linkOut = links.new(nodeEmission.outputs[0], nodeOut.inputs[0])
linkTexture = links.new(nodeTexture.outputs[0], nodeEmission.inputs[0])

# Configure Texture node
img = bpy.data.images.load('//test.png')
img.name = 'Test'
nodeTexture.image = img