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:
authorJulien Duroure <julien.duroure@gmail.com>2019-04-20 00:06:18 +0300
committerJulien Duroure <julien.duroure@gmail.com>2019-04-20 00:06:18 +0300
commite49613a5f9c879b1b525e8ac3e3c8af31c3eabcd (patch)
treed8e799111a5878e86eff2906daeb45d513e02446 /io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
parente4165cee8b34b216db5ff41b20b9a05991a4b4b7 (diff)
glTF: better occlusion map management
At import, create a node group where you can link an image texture At export, use this node group to create correctly the material TODO: doc update
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py')
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_image.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
index dbee622e..3e905a7d 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
@@ -170,10 +170,12 @@ def __get_image_data(sockets_or_slots, export_settings) -> gltf2_blender_image.E
composed_image = gltf2_blender_image.ExportImage.white_image(image.width, image.height)
# Change target channel for metallic and roughness.
- if elem.to_socket.name == 'Metallic':
+ if socket.name == 'Metallic':
composed_image[2] = image[source_channel]
- elif elem.to_socket.name == 'Roughness':
+ elif socket.name == 'Roughness':
composed_image[1] = image[source_channel]
+ elif socket.name == 'Occlusion' and len(sockets_or_slots) > 2:
+ composed_image[0] = image[source_channel]
else:
composed_image.update(image)