Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2020-09-21 14:33:06 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-09-21 14:45:29 +0300
commit636cc5496436fc2f63f7820d9ec7aa2933ebe212 (patch)
treea77566728547364a333c15d8e750907c75025cee /io_import_images_as_planes.py
parent0f7cd2f95434f470f2a88c6d365539a1fddbb0d9 (diff)
Fix T80983: Import Images as Planes links alpha to emission strength
This happened after the addition of emission strength, prefer using names over socket index. Based on patch by Evan Wilson. Differential Revision: https://developer.blender.org/D8965
Diffstat (limited to 'io_import_images_as_planes.py')
-rw-r--r--io_import_images_as_planes.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/io_import_images_as_planes.py b/io_import_images_as_planes.py
index 5783d70e..41d0c3f6 100644
--- a/io_import_images_as_planes.py
+++ b/io_import_images_as_planes.py
@@ -21,8 +21,8 @@
bl_info = {
"name": "Import Images as Planes",
"author": "Florian Meyer (tstscr), mont29, matali, Ted Schundler (SpkyElctrc)",
- "version": (3, 3, 1),
- "blender": (2, 80, 0),
+ "version": (3, 3, 2),
+ "blender": (2, 91, 5),
"location": "File > Import > Images as Planes or Add > Mesh > Images as Planes",
"description": "Imports images and creates planes with the appropriate aspect ratio. "
"The images are mapped to the planes.",
@@ -1016,24 +1016,24 @@ class IMPORT_IMAGE_OT_to_plane(Operator, AddObjectHelper):
core_shader = get_shadeless_node(node_tree)
else: # Emission Shading
core_shader = node_tree.nodes.new('ShaderNodeEmission')
- core_shader.inputs[1].default_value = self.emit_strength
+ core_shader.inputs['Strength'].default_value = self.emit_strength
# Connect color from texture
- node_tree.links.new(core_shader.inputs[0], tex_image.outputs[0])
+ node_tree.links.new(core_shader.inputs[0], tex_image.outputs['Color'])
if self.use_transparency:
if self.shader == 'PRINCIPLED':
- node_tree.links.new(core_shader.inputs[18], tex_image.outputs[1])
+ node_tree.links.new(core_shader.inputs['Alpha'], tex_image.outputs['Alpha'])
else:
bsdf_transparent = node_tree.nodes.new('ShaderNodeBsdfTransparent')
mix_shader = node_tree.nodes.new('ShaderNodeMixShader')
- node_tree.links.new(mix_shader.inputs[0], tex_image.outputs[1])
- node_tree.links.new(mix_shader.inputs[1], bsdf_transparent.outputs[0])
+ node_tree.links.new(mix_shader.inputs['Fac'], tex_image.outputs['Alpha'])
+ node_tree.links.new(mix_shader.inputs[1], bsdf_transparent.outputs['BSDF'])
node_tree.links.new(mix_shader.inputs[2], core_shader.outputs[0])
core_shader = mix_shader
- node_tree.links.new(out_node.inputs[0], core_shader.outputs[0])
+ node_tree.links.new(out_node.inputs['Surface'], core_shader.outputs[0])
auto_align_nodes(node_tree)
return material