diff --git a/scripts/addons_core/io_scene_gltf2/__init__.py b/scripts/addons_core/io_scene_gltf2/__init__.py index 6a71c23b517..9e750118c00 100755 --- a/scripts/addons_core/io_scene_gltf2/__init__.py +++ b/scripts/addons_core/io_scene_gltf2/__init__.py @@ -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, 3, 29), + "version": (4, 3, 30), 'blender': (4, 2, 0), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0', diff --git a/scripts/addons_core/io_scene_gltf2/blender/exp/material/image.py b/scripts/addons_core/io_scene_gltf2/blender/exp/material/image.py index ee108676e0b..639360a96fb 100644 --- a/scripts/addons_core/io_scene_gltf2/blender/exp/material/image.py +++ b/scripts/addons_core/io_scene_gltf2/blender/exp/material/image.py @@ -47,7 +47,11 @@ def gather_image( uri, factor_uri = __gather_uri(image_data, mime_type, name, export_settings) else: # 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, + blender_shader_sockets[0].socket.id_data.library, + export_settings + ) # In case we can't retrieve image (for example packed images, with original moved) # We don't create invalid image without uri factor_uri = None @@ -74,9 +78,9 @@ def gather_image( return image, image_data, factor, None -def __gather_original_uri(original_uri, export_settings): +def __gather_original_uri(original_uri, library, export_settings): + path_to_image = bpy.path.abspath(original_uri, library=library) - path_to_image = bpy.path.abspath(original_uri) if not os.path.exists(path_to_image): return None try: