From b53da37ad5681e3178f81cb5844420c79529d4ce Mon Sep 17 00:00:00 2001 From: Sun Kim Date: Tue, 3 Oct 2023 20:46:13 +0900 Subject: [PATCH] Update Images as Planes per new APIs Update per new shader and nodes APIs so Shadless and Emission types work again. --- io_import_images_as_planes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/io_import_images_as_planes.py b/io_import_images_as_planes.py index 97e1dbb91..b3b93d357 100644 --- a/io_import_images_as_planes.py +++ b/io_import_images_as_planes.py @@ -320,8 +320,8 @@ def get_shadeless_node(dest_node_tree): output_node = node_tree.nodes.new('NodeGroupOutput') input_node = node_tree.nodes.new('NodeGroupInput') - node_tree.outputs.new('NodeSocketShader', 'Shader') - node_tree.inputs.new('NodeSocketColor', 'Color') + node_tree.interface.new_socket('Shader', in_out='OUTPUT', socket_type='NodeSocketShader') + node_tree.interface.new_socket('Color', in_out='INPUT', socket_type='NodeSocketColor') # This could be faster as a transparent shader, but then no ambient occlusion diffuse_shader = node_tree.nodes.new('ShaderNodeBsdfDiffuse') @@ -1079,7 +1079,7 @@ class IMPORT_IMAGE_OT_to_plane(Operator, AddObjectHelper): if self.shader in {'PRINCIPLED', 'SHADELESS'}: node_tree.links.new(core_shader.inputs[0], tex_image.outputs['Color']) elif self.shader == 'EMISSION': - node_tree.links.new(core_shader.inputs['Emission'], tex_image.outputs['Color']) + node_tree.links.new(core_shader.inputs['Emission Color'], tex_image.outputs['Color']) if self.use_transparency: if self.shader in {'PRINCIPLED', 'EMISSION'}: -- 2.30.2