[Bf-extensions-cvs] [d9f17516] master: glTF exporter: fix file extension recognition for packed images
Julien Duroure
noreply at git.blender.org
Thu Mar 7 18:25:52 CET 2019
Commit: d9f17516414bce467e985a8d0b2329197bea1fa9
Author: Julien Duroure
Date: Thu Mar 7 18:24:24 2019 +0100
Branches: master
https://developer.blender.org/rBAd9f17516414bce467e985a8d0b2329197bea1fa9
glTF exporter: fix file extension recognition for packed images
===================================================================
M io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
===================================================================
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,
More information about the Bf-extensions-cvs
mailing list