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>2022-04-22 22:17:52 +0300
committerJulien Duroure <julien.duroure@gmail.com>2022-04-22 22:17:52 +0300
commitadf10c631570801e5434b29b1cc5f691d37db6da (patch)
tree1cf630c1bdd59b24437b2967084828f33478550d
parenta0ce684afe3ef7c37599941d1c3d1f46ca967e61 (diff)
glTF exporter: No texture export when original can't be retrieved
-rwxr-xr-xio_scene_gltf2/__init__.py2
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_image.py3
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py1
3 files changed, 5 insertions, 1 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 7585813a..c57370e2 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -4,7 +4,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
- "version": (3, 2, 28),
+ "version": (3, 2, 29),
'blender': (3, 1, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
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 8e43c2c1..bc035f8d 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
@@ -36,6 +36,9 @@ def gather_image(
else:
# Retrieve URI relative to exported glTF files
uri = __gather_original_uri(image_data.original.filepath, export_settings)
+ # In case we can't retrieve image (for example packed images, with original moved)
+ # We don't create invalid image without uri
+ if uri is None: return None
buffer_view = __gather_buffer_view(image_data, mime_type, name, export_settings)
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 0761b19c..e8c6baf1 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py
@@ -37,6 +37,7 @@ def gather_texture(
)
# although valid, most viewers can't handle missing source properties
+ # This can have None source for "keep original", when original can't be found
if texture.source is None:
return None