diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-04-20 00:06:18 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-04-20 00:06:18 +0300 |
commit | e49613a5f9c879b1b525e8ac3e3c8af31c3eabcd (patch) | |
tree | d8e799111a5878e86eff2906daeb45d513e02446 /io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py | |
parent | e4165cee8b34b216db5ff41b20b9a05991a4b4b7 (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-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py | 6 |
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) |