diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2020-04-18 10:39:07 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2020-04-18 10:39:07 +0300 |
commit | 45afacf7a630e7e77cdfc58c1b363e6e0e7747a5 (patch) | |
tree | 8fec5e6702a3061845857db8797507b20803d5bf /io_scene_gltf2/io/imp/gltf2_io_binary.py | |
parent | 4ef5cd10f6895fbee5704d088fdbc493c0874dd9 (diff) |
glTF importer: use friendly filenames for temp image files
Diffstat (limited to 'io_scene_gltf2/io/imp/gltf2_io_binary.py')
-rwxr-xr-x | io_scene_gltf2/io/imp/gltf2_io_binary.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/io_scene_gltf2/io/imp/gltf2_io_binary.py b/io_scene_gltf2/io/imp/gltf2_io_binary.py index 8815ed91..9057c17c 100755 --- a/io_scene_gltf2/io/imp/gltf2_io_binary.py +++ b/io_scene_gltf2/io/imp/gltf2_io_binary.py @@ -161,16 +161,14 @@ class BinaryData(): def get_image_data(gltf, img_idx): """Get data from image.""" pyimage = gltf.data.images[img_idx] - image_name = "Image_" + str(img_idx) - assert(not (pyimage.uri is not None and pyimage.buffer_view is not None)) + assert not ( + pyimage.uri is not None and + pyimage.buffer_view is not None + ) if pyimage.uri is not None: - data, file_name = gltf.load_uri(pyimage.uri) - return data, file_name or image_name - - elif pyimage.buffer_view is not None: - data = BinaryData.get_buffer_view(gltf, pyimage.buffer_view) - return data, image_name - - return None, None + return gltf.load_uri(pyimage.uri) + if pyimage.buffer_view is not None: + return BinaryData.get_buffer_view(gltf, pyimage.buffer_view) + return None |