Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-13 15:05:23 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-13 15:09:34 +0300
commit73df2edf635eee24a2c7a67068acd4d9410de9e5 (patch)
tree4721dec2d533e6a888c5f22f72c7ab11566e820c /io_coat3D/tex.py
parenta863bfffb158c96afd32a07fb6f83c781b5c0d5b (diff)
Shaders: update for color space moving from node to image datablock
Diffstat (limited to 'io_coat3D/tex.py')
-rw-r--r--io_coat3D/tex.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/io_coat3D/tex.py b/io_coat3D/tex.py
index a27c4547..eaed3302 100644
--- a/io_coat3D/tex.py
+++ b/io_coat3D/tex.py
@@ -543,18 +543,15 @@ def CreateTextureLine(type, act_material, main_mat, texcoat, coat3D, notegroup,
tex_img_node = texture_tree.nodes.new('ShaderNodeTexImage')
- if(type['colorspace'] == 'color' ):
- tex_img_node.color_space = 'COLOR'
- else:
- tex_img_node.color_space = 'NONE'
-
-
for ind, tex_index in enumerate(texcoat[type['name']]):
if(tex_index[0] == tile):
tex_img_node.image = bpy.data.images.load(texcoat[type['name']][ind][1])
break
tex_img_node.location = tex_loc
+ if tex_img_node.image and type['colorspace'] != 'color':
+ tex_img_node.image.colorspace_settings.is_data = True
+
tex_uv_node = texture_tree.nodes.new('ShaderNodeUVMap')
tex_uv_node.location = uv_loc
if(is_new):
@@ -689,8 +686,8 @@ def CreateTextureLine(type, act_material, main_mat, texcoat, coat3D, notegroup,
if(tile_list == []):
node.image = bpy.data.images.load(texcoat[type['name']][0])
- if(type['colorspace'] == 'noncolor'):
- node.color_space = 'NONE'
+ if node.image and type['colorspace'] == 'noncolor':
+ node.image.colorspace_settings.is_data = True
if (coat3D.createnodes):