diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-03-07 20:24:24 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-03-07 20:24:24 +0300 |
commit | d9f17516414bce467e985a8d0b2329197bea1fa9 (patch) | |
tree | e2fe3c448699f24e45919730975080da533d2136 /io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py | |
parent | 92c66013256f8de3effd0be3f77f156abfdf20f1 (diff) |
glTF exporter: fix file extension recognition for packed images
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 | 7 |
1 files changed, 6 insertions, 1 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 6b969668..63cd257b 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py @@ -157,10 +157,15 @@ def __get_image_data(sockets_or_slots, export_settings): source_channels_length = 1 file_name = os.path.splitext(result.shader_node.image.name)[0] + if result.shader_node.image.packed_file is None: + file_path = result.shader_node.image.filepath + else: + # empty path for packed textures, because they are converted to png anyway + file_path = "" image_data = gltf2_io_image_data.ImageData( file_name, - result.shader_node.image.filepath, + file_path, result.shader_node.image.size[0], result.shader_node.image.size[1], source_channel, |