Fix io_anim_camera error exporting cameras with quotes in their name
[blender-addons.git] / io_coat3D / updateimage.py
blob509f2b2ea20df986b4950d0d7b83be631876420f
1 # SPDX-License-Identifier: GPL-2.0-or-later
3 import bpy
4 import os
6 def update(texcoat,tex_type,node, udim_textures, udim_len):
8 if (os.path.normpath(texcoat[tex_type][0]) != os.path.normpath(node.image.filepath)):
9 tex_found = False
11 for image in bpy.data.images:
12 if (os.path.normpath(image.filepath) == os.path.normpath(texcoat[tex_type][0])):
13 node.image.use_fake_user = True
14 node.image = image
16 node.image.reload()
17 tex_found = True
19 break
21 if (tex_found == False):
22 node.image = bpy.data.images.load(texcoat[tex_type][0])
23 if(udim_textures):
24 node.image.source = 'TILED'
26 for udim_index in udim_len:
27 if (udim_index != 1001):
28 node.image.tiles.new(udim_index)