Skip to content
Snippets Groups Projects
Commit adf10c63 authored by Julien Duroure's avatar Julien Duroure
Browse files

glTF exporter: No texture export when original can't be retrieved

parent a0ce684a
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
bl_info = { bl_info = {
'name': 'glTF 2.0 format', 'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', '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), 'blender': (3, 1, 0),
'location': 'File > Import-Export', 'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0', 'description': 'Import-Export as glTF 2.0',
......
...@@ -36,6 +36,9 @@ def gather_image( ...@@ -36,6 +36,9 @@ def gather_image(
else: else:
# Retrieve URI relative to exported glTF files # Retrieve URI relative to exported glTF files
uri = __gather_original_uri(image_data.original.filepath, export_settings) 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) buffer_view = __gather_buffer_view(image_data, mime_type, name, export_settings)
......
...@@ -37,6 +37,7 @@ def gather_texture( ...@@ -37,6 +37,7 @@ def gather_texture(
) )
# although valid, most viewers can't handle missing source properties # 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: if texture.source is None:
return None return None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment