From 2b8e2a551ed6be785a34977590fee4ea4de03c13 Mon Sep 17 00:00:00 2001 From: Sebastian Sille Date: Wed, 25 Oct 2023 17:23:17 +0200 Subject: [PATCH] Import_3ds: Added tintcolors for coat and sheen tint values --- io_scene_3ds/import_3ds.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/io_scene_3ds/import_3ds.py b/io_scene_3ds/import_3ds.py index 5c2519e7..611db65c 100644 --- a/io_scene_3ds/import_3ds.py +++ b/io_scene_3ds/import_3ds.py @@ -274,6 +274,10 @@ def add_texture_to_material(image, contextWrapper, pct, extend, alpha, scale, of elif mapto == 'SPECULARITY': shader.location = (300,0) img_wrap = contextWrapper.specular_tint_texture + if tint1: + img_wrap.node_dst.inputs['Coat Tint'].default_value = tint1[:3] + [1] + if tint2: + img_wrap.node_dst.inputs['Sheen Tint'].default_value = tint2[:3] + [1] elif mapto == 'ALPHA': shader.location = (-300,0) img_wrap = contextWrapper.alpha_texture @@ -324,8 +328,11 @@ def add_texture_to_material(image, contextWrapper, pct, extend, alpha, scale, of own_map = img_wrap.node_mapping if tex == image.name: links.new(link.from_node.outputs['Alpha'], img_wrap.socket_dst) - nodes.remove(own_map) - nodes.remove(own_node) + try: + nodes.remove(own_map) + nodes.remove(own_node) + except: + pass for imgs in bpy.data.images: if imgs.name[-3:].isdigit(): if not imgs.users: -- 2.11.4.GIT