Skip to content

Commit

Permalink
Make Cycles emission autogenerated material trully shadeless (not cas…
Browse files Browse the repository at this point in the history
…t light)
  • Loading branch information
ZanQdo committed Jul 16, 2012
1 parent c07f1b9 commit 82e3e81
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions io_import_images_as_planes.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,11 +524,13 @@ def create_cycles_material(self, image):

elif self.shader == 'EMISSION':
emission = node_tree.nodes.new('EMISSION')
lightpath = node_tree.nodes.new('LIGHT_PATH')
tex_image = node_tree.nodes.new('TEX_IMAGE')
tex_image.image = image
tex_image.show_texture = True
node_tree.links.new(out_node.inputs[0], emission.outputs[0])
node_tree.links.new(emission.inputs[0], tex_image.outputs[0])
node_tree.links.new(emission.inputs[1], lightpath.outputs[0])

elif self.shader == 'BSDF_DIFFUSE_BSDF_TRANSPARENT':
bsdf_diffuse = node_tree.nodes.new('BSDF_DIFFUSE')
Expand All @@ -545,6 +547,7 @@ def create_cycles_material(self, image):

elif self.shader == 'EMISSION_BSDF_TRANSPARENT':
emission = node_tree.nodes.new('EMISSION')
lightpath = node_tree.nodes.new('LIGHT_PATH')
bsdf_transparent = node_tree.nodes.new('BSDF_TRANSPARENT')
mix_shader = node_tree.nodes.new('MIX_SHADER')
tex_image = node_tree.nodes.new('TEX_IMAGE')
Expand All @@ -555,6 +558,7 @@ def create_cycles_material(self, image):
node_tree.links.new(mix_shader.inputs[2], emission.outputs[0])
node_tree.links.new(mix_shader.inputs[1], bsdf_transparent.outputs[0])
node_tree.links.new(emission.inputs[0], tex_image.outputs[0])
node_tree.links.new(emission.inputs[1], lightpath.outputs[0])

auto_align_nodes(node_tree)
return material
Expand Down

0 comments on commit 82e3e81

Please sign in to comment.