From 3ee576bc2d85cab7c1997b156504ca6d8adf9715 Mon Sep 17 00:00:00 2001
From: Samuli Riihikoski <haikalle@gmail.com>
Date: Wed, 16 Sep 2020 10:10:04 +0300
Subject: [PATCH] io_coat3D: fix udim bug

---
 io_coat3D/tex.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/io_coat3D/tex.py b/io_coat3D/tex.py
index 0a1ba0622..45f8e7bbd 100644
--- a/io_coat3D/tex.py
+++ b/io_coat3D/tex.py
@@ -526,7 +526,8 @@ def CreateTextureLine(type, act_material, main_mat, texcoat, coat3D, notegroup,
                 node.image.source = 'TILED'
                 for udim_index in udim_len:
                     if (udim_index != 1001):
-                        image.tiles.new(udim_index)
+                        node.image.tiles.new(udim_index)
+                        print('AA')
 
             node.image.reload()
          
@@ -541,7 +542,9 @@ def CreateTextureLine(type, act_material, main_mat, texcoat, coat3D, notegroup,
 
         for udim_index in udim_len:
             if (udim_index != 1001):
-                image.tiles.new(udim_index)
+                node.image.tiles.new(udim_index)
+                print('image:', node.image)
+                print('BB')
 
   
 
@@ -718,6 +721,7 @@ def matlab(objekti,mat_list,texturelist,is_new):
                     udim_indexs.append(int(texture[0]))
 
             udim_indexs.sort()
+            print('udim_indexa:', udim_indexs)
 
         if(udim_textures == False):
             readtexturefolder(objekti,mat_list,texturelist,is_new, udim_textures, udim_indexs)
-- 
GitLab