diff options
author | Kalle-Samuli Riihikoski <haikalle@gmail.com> | 2019-02-18 11:06:07 +0300 |
---|---|---|
committer | Kalle-Samuli Riihikoski <haikalle@gmail.com> | 2019-02-18 11:06:07 +0300 |
commit | 0921d493d620e27d47f4869e6a2e238f0c7cf8e4 (patch) | |
tree | 7a7285dadeb38e613c1399c33b506313e7e9fbb8 | |
parent | 09fcadb75b1d8ce7d254b6b2903e532247e613e3 (diff) |
Change back to Treat materials as separate textures = ON
-rw-r--r-- | io_coat3D/__init__.py | 2 | ||||
-rw-r--r-- | io_coat3D/tex.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/io_coat3D/__init__.py b/io_coat3D/__init__.py index 264eb96a..51019657 100644 --- a/io_coat3D/__init__.py +++ b/io_coat3D/__init__.py @@ -559,7 +559,7 @@ class SCENE_OT_export(bpy.types.Operator): final_bake_name = toi[:-1] bpy.data.images[bake_image].save() print('Baking OBJ:', objekti) - temp_string += '''\n[script ImportTexture("''' + bake_list[index_bake_tex][1] + '''","''' + objekti.data.uv_layers[0].name + '''","''' + final_bake_name + '''");]''' + temp_string += '''\n[script ImportTexture("''' + bake_list[index_bake_tex][1] + '''","''' + objekti.material_slots[bake_mat_index].material.name + '''","''' + final_bake_name + '''");]''' bake_index += 1 diff --git a/io_coat3D/tex.py b/io_coat3D/tex.py index ca41d0ce..b4a1b87e 100644 --- a/io_coat3D/tex.py +++ b/io_coat3D/tex.py @@ -78,8 +78,8 @@ def UVTiling(objekti, texturelist): def readtexturefolder(objekti, mat_list, texturelist, is_new): #read textures from texture file create_nodes = False - - if texturelist[0][0] == '1001': + print('texturelist:', texturelist) + if texturelist[0][0].startswith('100'): print('This is UVTiling') texturelist = UVTiling(objekti, texturelist) print('texturelist:', texturelist) @@ -98,7 +98,7 @@ def readtexturefolder(objekti, mat_list, texturelist, is_new): #read textures fr create_group_node = False for texture_info in texturelist: - if texture_info[0] == objekti.data.uv_layers[0].name: + 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 |