Unable to link 2 nodes to mixshader at once (python) Somehow this code is unable to bind two nodes(Emission and BsdfTransparent) to mixshader input at once. I'm able to do it in the node selector view and get the result i want. Anyone know whats wrong ?

### create nodes
emission_ = genMat.node_tree.nodes.new(type = 'ShaderNodeEmission')
output = genMat.node_tree.nodes.new(type = 'ShaderNodeOutputMaterial')
tex_coord = genMat.node_tree.nodes.new(type = 'ShaderNodeTexCoord')
image_texture = genMat.node_tree.nodes.new(type = 'ShaderNodeTexImage')
#for adding alpha channel to shaders
mix = genMat.node_tree.nodes.new(type = 'ShaderNodeMixShader')
trans = genMat.node_tree.nodes.new(type = 'ShaderNodeBsdfTransparent')

### linking nodes
genMat.node_tree.links.new(tex_coord.outputs['Generated'],image_texture.inputs['Vector'])
genMat.node_tree.links.new(image_texture.outputs['Color'],emission_.inputs['Color'])
genMat.node_tree.links.new(image_texture.outputs['Alpha'],mix.inputs['Fac'])
genMat.node_tree.links.new(emission_.outputs['Emission'],mix.inputs['Shader'])
genMat.node_tree.links.new(mix.outputs['Shader'],output.inputs['Surface'])
genMat.node_tree.links.new(trans.outputs['BSDF'],mix.inputs['Shader'])
genMat.node_tree.links.new(image_texture.outputs['Color'],emission_.inputs['Color'])
When a node has two inputs with the same name, for instance 2 color inputs, then you should pass the index instead of the input name.

# both inputs are called 'Color', so it's not enough
links.new(image_texture.outputs['Color'], emission_.inputs[0])
links.new(image_texture_2.outputs['Color'], emission_.inputs[1])


The shader mix node has 3 inputs, two are called 'Shader'. You'll need to use indices to distinguish each. 

# The mix.inputs[0] is the factor, indexing starts at zero
links.new(emission_.outputs['Emission'], mix.inputs[1])   # shader 1
links.new(trans.outputs['BSDF'], mix.inputs[2])           # shader 2