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_scene_gltf2
parenta863bfffb158c96afd32a07fb6f83c781b5c0d5b (diff)
Shaders: update for color space moving from node to image datablock
Diffstat (limited to 'io_scene_gltf2')
-rwxr-xr-xio_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py6
-rwxr-xr-xio_scene_gltf2/blender/imp/gltf2_blender_map_normal.py3
-rwxr-xr-xio_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py6
3 files changed, 10 insertions, 5 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py b/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py
index 0365fa18..13ab78f8 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py
@@ -285,7 +285,8 @@ class BlenderKHR_materials_pbrSpecularGlossiness():
gltf.data.textures[pbrSG['specularGlossinessTexture']['index']].source
].blender_image_name
]
- spec_text.color_space = 'NONE'
+ if spec_text.image:
+ spec_text.image.colorspace_settings.is_data = True
spec_text.location = -500, 0
spec_mapping = node_tree.nodes.new('ShaderNodeMapping')
@@ -323,7 +324,8 @@ class BlenderKHR_materials_pbrSpecularGlossiness():
spec_text.image = bpy.data.images[gltf.data.images[
gltf.data.textures[pbrSG['specularGlossinessTexture']['index']].source
].blender_image_name]
- spec_text.color_space = 'NONE'
+ if spec_text.image:
+ spec_text.image.colorspace_settings.is_data = True
spec_text.location = -1000, 0
spec_math = node_tree.nodes.new('ShaderNodeMath')
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_map_normal.py b/io_scene_gltf2/blender/imp/gltf2_blender_map_normal.py
index 9cc23db8..6631ad0b 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_map_normal.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_map_normal.py
@@ -66,7 +66,8 @@ class BlenderNormalMap():
gltf.data.textures[pymaterial.normal_texture.index].source
].blender_image_name]
text.label = 'NORMALMAP'
- text.color_space = 'NONE'
+ if text.image:
+ text.image.colorspace_settings.is_data = True
text.location = -500, -500
normalmap_node = node_tree.nodes.new('ShaderNodeNormalMap')
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py b/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py
index 05e6f580..eb7ca9e7 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py
@@ -237,7 +237,8 @@ class BlenderPbr():
metallic_text.image = bpy.data.images[gltf.data.images[
gltf.data.textures[pypbr.metallic_roughness_texture.index].source
].blender_image_name]
- metallic_text.color_space = 'NONE'
+ if metallic_text.image:
+ metallic_text.image.colorspace_settings.is_data = True
metallic_text.label = 'METALLIC ROUGHNESS'
metallic_text.location = -500, 0
@@ -270,7 +271,8 @@ class BlenderPbr():
metallic_text.image = bpy.data.images[gltf.data.images[
gltf.data.textures[pypbr.metallic_roughness_texture.index].source
].blender_image_name]
- metallic_text.color_space = 'NONE'
+ if metallic_text.image:
+ metallic_text.image.colorspace_settings.is_data = True
metallic_text.label = 'METALLIC ROUGHNESS'
metallic_text.location = -1000, 0