diff options
author | Samuli Riihikoski <haikalle@gmail.com> | 2020-09-24 03:45:40 +0300 |
---|---|---|
committer | Samuli Riihikoski <haikalle@gmail.com> | 2020-09-24 03:45:40 +0300 |
commit | 3d2076556a73af15779fc06630a3254fd584af02 (patch) | |
tree | 1723c05d025b26e809baa47a82c0618107478aa4 /io_coat3D/updateimage.py | |
parent | 574d0886ece1baf1e003aea9ec4be0718e6e1ab5 (diff) |
io_coat3D: fixed prefix update bug
Diffstat (limited to 'io_coat3D/updateimage.py')
-rw-r--r-- | io_coat3D/updateimage.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/io_coat3D/updateimage.py b/io_coat3D/updateimage.py index d0caa9d6..72d4d826 100644 --- a/io_coat3D/updateimage.py +++ b/io_coat3D/updateimage.py @@ -1,16 +1,26 @@ import bpy import os -def update(texcoat,tex_type,node): +def update(texcoat,tex_type,node, udim_textures, udim_len): if (os.path.normpath(texcoat[tex_type][0]) != os.path.normpath(node.image.filepath)): tex_found = False for image in bpy.data.images: if (os.path.normpath(image.filepath) == os.path.normpath(texcoat[tex_type][0])): + node.image = image + + node.image.reload() tex_found = True + break if (tex_found == False): node.image = bpy.data.images.load(texcoat[tex_type][0]) + if(udim_textures): + node.image.source = 'TILED' + + for udim_index in udim_len: + if (udim_index != 1001): + node.image.tiles.new(udim_index) |