From e47d36c9c937a602bd96e22e318c6f4bb2260418 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 21 Jul 2026 16:52:22 +0900 Subject: [PATCH] =?UTF-8?q?VRM-0.X=20=E3=81=AE=20export=20dialog=20?= =?UTF-8?q?=E3=81=8B=E3=82=89=20RuntimeTextureSerializer=20=E3=82=92?= =?UTF-8?q?=E9=81=B8=E6=8A=9E=E3=81=A7=E3=81=8D=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #2762 --- Packages/VRM/Editor/Format/VRMEditorExporter.cs | 2 +- Packages/VRM/Editor/Format/VRMExportOptions.cs | 6 +++++- Packages/VRM/Editor/Format/VRMExportSettings.cs | 6 ++++++ Packages/VRM/Editor/Format/VRMExportSettingsEditor.cs | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Packages/VRM/Editor/Format/VRMEditorExporter.cs b/Packages/VRM/Editor/Format/VRMEditorExporter.cs index 47bbba57e..1409239fe 100644 --- a/Packages/VRM/Editor/Format/VRMEditorExporter.cs +++ b/Packages/VRM/Editor/Format/VRMEditorExporter.cs @@ -239,7 +239,7 @@ namespace VRM using (var exporter = new VRMExporter(data, gltfExportSettings, animationExporter: settings.KeepAnimation ? new EditorAnimationExporter() : null, materialExporter: materialExporter, - textureSerializer: new EditorTextureSerializer())) + textureSerializer: settings.KeepTextureAssetConfiguration ? new RuntimeTextureSerializer() : new EditorTextureSerializer())) { exporter.Prepare(target); exporter.Export(); diff --git a/Packages/VRM/Editor/Format/VRMExportOptions.cs b/Packages/VRM/Editor/Format/VRMExportOptions.cs index dfe78e7ea..4dead8a2a 100644 --- a/Packages/VRM/Editor/Format/VRMExportOptions.cs +++ b/Packages/VRM/Editor/Format/VRMExportOptions.cs @@ -53,7 +53,11 @@ namespace VRM KEEP_VERTEX_COLOR, [LangMsg(Languages.ja, "glTF Animationをエクスポートする。")] - [LangMsg(Languages.en, "export glTF animation.")] + [LangMsg(Languages.en, "Export glTF animation.")] EXPORT_GLTF_ANIMATION, + + [LangMsg(Languages.ja, "テクスチャーアセット設定を変更しない。")] + [LangMsg(Languages.en, "Keep texture asset configuration.")] + KEEP_TEXTURE_ASSET_CONFIGURATION, } } diff --git a/Packages/VRM/Editor/Format/VRMExportSettings.cs b/Packages/VRM/Editor/Format/VRMExportSettings.cs index 29b93d57e..4d08e4ba9 100644 --- a/Packages/VRM/Editor/Format/VRMExportSettings.cs +++ b/Packages/VRM/Editor/Format/VRMExportSettings.cs @@ -67,6 +67,12 @@ namespace VRM [Tooltip("Keep animation")] public bool KeepAnimation = false; + /// + /// Export時にTexture設定を変更しない + /// + [Tooltip("Keep texture configuration")] + public bool KeepTextureAssetConfiguration = false; + public GltfExportSettings GltfExportSettings => new GltfExportSettings { UseSparseAccessorForMorphTarget = UseSparseAccessor, diff --git a/Packages/VRM/Editor/Format/VRMExportSettingsEditor.cs b/Packages/VRM/Editor/Format/VRMExportSettingsEditor.cs index 3df60f240..68c7113c6 100644 --- a/Packages/VRM/Editor/Format/VRMExportSettingsEditor.cs +++ b/Packages/VRM/Editor/Format/VRMExportSettingsEditor.cs @@ -56,6 +56,7 @@ namespace VRM m_checkbox_list.Add(new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.DivideVertexBuffer)), VRMExportOptions.DIVIDE_VERTEX_BUFFER)); m_checkbox_list.Add(new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.KeepVertexColor)), VRMExportOptions.KEEP_VERTEX_COLOR)); m_checkbox_list.Add(new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.KeepAnimation)), VRMExportOptions.EXPORT_GLTF_ANIMATION)); + m_checkbox_list.Add(new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.KeepTextureAssetConfiguration)), VRMExportOptions.KEEP_TEXTURE_ASSET_CONFIGURATION)); }