From 2b4ecb5e73b359796c9001b28d521678a64fa1f1 Mon Sep 17 00:00:00 2001 From: Gene Tailor Date: Mon, 16 Feb 2026 21:37:44 +0000 Subject: [PATCH] Applied same *AssetEditing improvements to the Texture extracting section of TextureExtractor.ExtractTextures() to batch the importing of created Textures. --- .../ScriptedImporter/TextureExtractor.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Packages/UniGLTF/Editor/UniGLTF/ScriptedImporter/TextureExtractor.cs b/Packages/UniGLTF/Editor/UniGLTF/ScriptedImporter/TextureExtractor.cs index 40fd43d10..cac1a48c8 100644 --- a/Packages/UniGLTF/Editor/UniGLTF/ScriptedImporter/TextureExtractor.cs +++ b/Packages/UniGLTF/Editor/UniGLTF/ScriptedImporter/TextureExtractor.cs @@ -84,9 +84,22 @@ namespace UniGLTF s_MarkerStartExtractTextures.Begin(); var extractor = new TextureExtractor(data, textureDirectory, subAssets); - foreach (var param in textureDescriptorGenerator.Get().GetEnumerable()) + try { - extractor.Extract(param.SubAssetKey, param); + AssetDatabase.StartAssetEditing(); + + foreach (var param in textureDescriptorGenerator.Get().GetEnumerable()) + { + extractor.Extract(param.SubAssetKey, param); + } + } + catch (Exception e) + { + Debug.LogException(e); + } + finally + { + AssetDatabase.StopAssetEditing(); } s_MarkerStartExtractTextures.End();