This commit is contained in:
ousttrue 2021-04-20 21:07:59 +09:00
parent 8e8ee5cf65
commit da41a5cc67
3 changed files with 18 additions and 5 deletions

View File

@ -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());
}

View File

@ -64,13 +64,15 @@ namespace VRM
{
VRMExportSettings = settings;
Clips = new List<BlendShapeClip>();
var proxy = ExportRoot.GetComponent<VRMBlendShapeProxy>();
if (proxy != null)
if (ExportRoot != null)
{
// Export サイズ の 計算
if (proxy.BlendShapeAvatar != null)
var proxy = ExportRoot.GetComponent<VRMBlendShapeProxy>();
if (proxy != null)
{
Clips.AddRange(proxy.BlendShapeAvatar.Clips);
if (proxy.BlendShapeAvatar != null)
{
Clips.AddRange(proxy.BlendShapeAvatar.Clips);
}
}
}

View File

@ -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);