From 211ffe9446da8dbada6ab5827c1edb952350aac0 Mon Sep 17 00:00:00 2001 From: Heros <1131602048@trakya.edu.tr> Date: Mon, 6 Mar 2023 16:51:27 +0300 Subject: [PATCH 1/2] Fixed an error when importing textures embedded in gltf. Fixed an error when importing textures embedded in gltf. --- send2ue/core/utilities.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/send2ue/core/utilities.py b/send2ue/core/utilities.py index 902aad05..699c1d86 100644 --- a/send2ue/core/utilities.py +++ b/send2ue/core/utilities.py @@ -1635,7 +1635,12 @@ def unpack_textures(): # if the unpacked image does not exist on disk if not os.path.exists(image.filepath_from_user()): # unpack the image - image.unpack() + if len(image.filepath_from_user()) == 0: + image.filepath = '/Texture/{}'.format(image.name) + image.save() + else: + image.unpack() + unpacked_files[image.name] = image.filepath_from_user() return unpacked_files From 9225cc45796217f8b3e807c265a91b940898afdb Mon Sep 17 00:00:00 2001 From: Heros <1131602048@trakya.edu.tr> Date: Mon, 6 Mar 2023 17:00:00 +0300 Subject: [PATCH 2/2] Update utilities.py --- send2ue/core/utilities.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/send2ue/core/utilities.py b/send2ue/core/utilities.py index 699c1d86..5d617cce 100644 --- a/send2ue/core/utilities.py +++ b/send2ue/core/utilities.py @@ -1637,10 +1637,8 @@ def unpack_textures(): # unpack the image if len(image.filepath_from_user()) == 0: image.filepath = '/Texture/{}'.format(image.name) - image.save() - else: - image.unpack() + image.save() unpacked_files[image.name] = image.filepath_from_user() return unpacked_files