glTF: Better error handling when image is not found

This commit is contained in:
Julien Duroure
2025-05-02 15:42:33 +02:00
parent f879c37a06
commit bc8a39fba0
2 changed files with 3 additions and 1 deletions

View File

@@ -5,7 +5,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": (4, 5, 25),
"version": (4, 5, 26),
'blender': (4, 4, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@@ -413,6 +413,7 @@ class ExportImage:
return _encode_temp_image(tmp_image, self.file_format, export_settings)
def __encode_from_image_tile(self, udim_image, tile, export_settings):
data = None
src_path = bpy.path.abspath(udim_image.filepath_raw).replace("<UDIM>", tile)
if os.path.isfile(src_path):
@@ -433,6 +434,7 @@ class ExportImage:
# We don't manage UDIM packed image, so this could not happen to be here
# Lets display an error
export_settings['log'].error("UDIM packed images are not supported for export. Please unpack them before exporting.")
return b''
def _encode_temp_image(tmp_image: bpy.types.Image, file_format: str, export_settings) -> bytes: