diff --git a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/ExportDialogBase.cs b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/ExportDialogBase.cs index 60c3c98ae..30034f70b 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/ExportDialogBase.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/ExportDialogBase.cs @@ -91,6 +91,10 @@ namespace UniGLTF protected abstract bool DoGUI(); + protected virtual void OnLayout() + { + } + bool BeginGUI() { // ArgumentException: Getting control 1's position in a group with only 1 controls when doing repaint Aborting @@ -98,6 +102,7 @@ namespace UniGLTF // EventType.Layout と EventType.Repaint 間で内容が変わらないようしている。 if (Event.current.type == EventType.Layout) { + OnLayout(); State.Validate(ValidatorFactory()); } diff --git a/Assets/VRM/Editor/Format/VRMExportMeshes.cs b/Assets/VRM/Editor/Format/VRMExportMeshes.cs index e0f3202be..595161014 100644 --- a/Assets/VRM/Editor/Format/VRMExportMeshes.cs +++ b/Assets/VRM/Editor/Format/VRMExportMeshes.cs @@ -64,13 +64,15 @@ namespace VRM { VRMExportSettings = settings; Clips = new List(); - var proxy = ExportRoot.GetComponent(); - if (proxy != null) + if (ExportRoot != null) { - // Export サイズ の 計算 - if (proxy.BlendShapeAvatar != null) + var proxy = ExportRoot.GetComponent(); + if (proxy != null) { - Clips.AddRange(proxy.BlendShapeAvatar.Clips); + if (proxy.BlendShapeAvatar != null) + { + Clips.AddRange(proxy.BlendShapeAvatar.Clips); + } } } diff --git a/Assets/VRM/Editor/Format/VRMExporterWizard.cs b/Assets/VRM/Editor/Format/VRMExporterWizard.cs index 1bb73b27a..12dc64bfb 100644 --- a/Assets/VRM/Editor/Format/VRMExporterWizard.cs +++ b/Assets/VRM/Editor/Format/VRMExporterWizard.cs @@ -160,6 +160,12 @@ namespace VRM VRMEditorExporter.Export(path, State.ExportRoot, Meta != null ? Meta : m_tmpMeta, m_settings, m_meshes.Meshes); } + protected override void OnLayout() + { + // m_settings, m_meshes.Meshes + m_meshes.SetRoot(State.ExportRoot, m_settings); + } + protected override bool DoGUI() { EditorGUILayout.HelpBox($"Mesh size: {m_meshes.ExpectedExportByteSize / 1000000.0f:0.0} MByte", MessageType.Info);