diff options
author | Kalle-Samuli Riihikoski <haikalle@gmail.com> | 2019-03-06 21:38:27 +0300 |
---|---|---|
committer | Kalle-Samuli Riihikoski <haikalle@gmail.com> | 2019-03-06 21:38:27 +0300 |
commit | 44604c923b2f40bca4efc32e6d2fb483808e5613 (patch) | |
tree | 411feb851aa107239eeeafe69af4277243115870 /io_coat3D/tex.py | |
parent | 22f3abe81afd1ad4fcfc712d674a6046baee000a (diff) |
users has now control what textures are linked to material.
Diffstat (limited to 'io_coat3D/tex.py')
-rw-r--r-- | io_coat3D/tex.py | 56 |
1 files changed, 40 insertions, 16 deletions
diff --git a/io_coat3D/tex.py b/io_coat3D/tex.py index edb03d36..5b70c0b4 100644 --- a/io_coat3D/tex.py +++ b/io_coat3D/tex.py @@ -160,29 +160,53 @@ def readtexturefolder(objekti, mat_list, texturelist, is_new, udim_textures): #r if texture_info[0] == index_mat.name: if texture_info[2] == 'color' or texture_info[2] == 'diffuse': - texcoat['color'].append(texture_info[3]) - create_nodes = True + if(index_mat.material.coat3D_diffuse): + texcoat['color'].append(texture_info[3]) + create_nodes = True + else: + os.remove(texture_info[3]) elif texture_info[2] == 'metalness' or texture_info[2] == 'specular' or texture_info[2] == 'reflection': - texcoat['metalness'].append(texture_info[3]) - create_nodes = True + if (index_mat.material.coat3D_metalness): + texcoat['metalness'].append(texture_info[3]) + create_nodes = True + else: + os.remove(texture_info[3]) elif texture_info[2] == 'rough' or texture_info[2] == 'roughness': - texcoat['rough'].append(texture_info[3]) - create_nodes = True + if (index_mat.material.coat3D_roughness): + texcoat['rough'].append(texture_info[3]) + create_nodes = True + else: + os.remove(texture_info[3]) elif texture_info[2] == 'nmap' or texture_info[2] == 'normalmap' or texture_info[2] == 'normal_map' or texture_info[2] == 'normal': - texcoat['nmap'].append(texture_info[3]) - create_nodes = True + if (index_mat.material.coat3D_normal): + texcoat['nmap'].append(texture_info[3]) + create_nodes = True + else: + os.remove(texture_info[3]) elif texture_info[2] == 'emissive': - texcoat['emissive'].append(texture_info[3]) - create_nodes = True + if (index_mat.material.coat3D_emissive): + texcoat['emissive'].append(texture_info[3]) + create_nodes = True + else: + os.remove(texture_info[3]) elif texture_info[2] == 'emissive_power': - texcoat['emissive_power'].append(texture_info[3]) - create_nodes = True + if (index_mat.material.coat3D_emissive): + texcoat['emissive_power'].append(texture_info[3]) + create_nodes = True + else: + os.remove(texture_info[3]) elif texture_info[2] == 'ao': - texcoat['ao'].append(texture_info[3]) - create_nodes = True + if (index_mat.material.coat3D_ao): + texcoat['ao'].append(texture_info[3]) + create_nodes = True + else: + os.remove(texture_info[3]) elif texture_info[2].startswith('displacement'): - texcoat['displacement'].append(texture_info[3]) - create_nodes = True + if (index_mat.material.coat3D_displacement): + texcoat['displacement'].append(texture_info[3]) + create_nodes = True + else: + os.remove(texture_info[3]) create_group_node = True else: for texture_info in texturelist: |