From f5881cb567e67e47d68d04d3a4f23d02e3abb709 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 9 Jul 2026 13:45:15 +0900 Subject: [PATCH] Fix import Exception from Unity-6.4 --- .../Texture/Importer/TextureImporterConfigurator.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Packages/UniGLTF/Editor/UniGLTF/IO/Texture/Importer/TextureImporterConfigurator.cs b/Packages/UniGLTF/Editor/UniGLTF/IO/Texture/Importer/TextureImporterConfigurator.cs index ccf176dab..a29adacde 100644 --- a/Packages/UniGLTF/Editor/UniGLTF/IO/Texture/Importer/TextureImporterConfigurator.cs +++ b/Packages/UniGLTF/Editor/UniGLTF/IO/Texture/Importer/TextureImporterConfigurator.cs @@ -81,7 +81,17 @@ namespace UniGLTF if (!EditorTextureUtility.TryGetAsEditorTexture2DAsset(externalTexture, out var texture2D, out var importer)) return; Configure(texDesc, importer); - importer.SaveAndReimport(); + + // https://github.com/vrm-c/UniVRM/issues/2813 (4) + // https://github.com/vrm-c/UniVRM/issues/2783 + // + // UnityException: Calls to "AssetDatabase.ImportAsset" are restricted during asset importing. + // Please make sure this function is not called from ScriptedImporters or PostProcessors, + // as it is a source of non-determinism. + UnityEditor.EditorApplication.delayCall += () => + { + importer.SaveAndReimport(); + }; } } }