diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-03-23 12:01:09 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-03-23 12:01:09 +0300 |
commit | 5371d6eadeafa35be8bc4f81057c3c4bfaf6d0d9 (patch) | |
tree | a6c0a337b3ffd324344858e3282a7af380e5093d /io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py | |
parent | e16c6704b32741c510bb05993b7edf77d4a77b57 (diff) |
glTF exporter: support empty images
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py index 93db33f9..8ada0f77 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py @@ -39,7 +39,7 @@ def gather_texture( if not __filter_texture(blender_shader_sockets_or_texture_slots, export_settings): return None - return gltf2_io.Texture( + texture = gltf2_io.Texture( extensions=__gather_extensions(blender_shader_sockets_or_texture_slots, export_settings), extras=__gather_extras(blender_shader_sockets_or_texture_slots, export_settings), name=__gather_name(blender_shader_sockets_or_texture_slots, export_settings), @@ -47,6 +47,12 @@ def gather_texture( source=__gather_source(blender_shader_sockets_or_texture_slots, export_settings) ) + # although valid, most viewers cant handle missing source properties + if texture.source is None: + return None + + return texture + def __filter_texture(blender_shader_sockets_or_texture_slots, export_settings): return True |