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-03-07 20:24:24 +0300
committerJulien Duroure <julien.duroure@gmail.com>2019-03-07 20:24:24 +0300
commitd9f17516414bce467e985a8d0b2329197bea1fa9 (patch)
treee2fe3c448699f24e45919730975080da533d2136 /io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
parent92c66013256f8de3effd0be3f77f156abfdf20f1 (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-xio_scene_gltf2/blender/exp/gltf2_blender_gather_image.py7
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,