Merge pull request #2181 from FujiSunflower/master

Simplified some GUI
This commit is contained in:
ousttrue
2023-11-01 18:30:28 +09:00
committed by GitHub
4 changed files with 29 additions and 24 deletions

View File

@@ -144,33 +144,32 @@ namespace UniGLTF
//
// Create and Other Buttons
{
// errors
GUILayout.BeginVertical();
// GUILayout.FlexibleSpace();
// errors
using (new GUILayout.VerticalScope())
{
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
GUI.enabled = State.Validations.All(x => x.CanExport);
if (GUILayout.Button("Export", GUILayout.MinWidth(100)))
// GUILayout.FlexibleSpace();
{
var path = SaveFileDialog.GetPath(SaveTitle, SaveName, SaveExtensions);
if (!string.IsNullOrEmpty(path))
using (new GUILayout.HorizontalScope())
{
ExportPath(path);
// close
Close();
GUIUtility.ExitGUI();
GUILayout.FlexibleSpace();
GUI.enabled = State.Validations.All(x => x.CanExport);
if (GUILayout.Button("Export", GUILayout.MinWidth(100)))
{
var path = SaveFileDialog.GetPath(SaveTitle, SaveName, SaveExtensions);
if (!string.IsNullOrEmpty(path))
{
ExportPath(path);
// close
Close();
GUIUtility.ExitGUI();
}
}
GUI.enabled = true;
}
}
GUI.enabled = true;
GUILayout.EndHorizontal();
}
GUILayout.EndVertical();
}
GUILayout.Space(8);
}

View File

@@ -15,8 +15,7 @@ namespace UniVRM10
{
public static void Open()
{
var window = (VRM10ExportDialog)GetWindow(typeof(VRM10ExportDialog));
window.titleContent = new GUIContent("VRM-1.0 Exporter");
var window = GetWindow<VRM10ExportDialog>("VRM-1.0 Exporter");
window.Show();
}
@@ -203,7 +202,7 @@ namespace UniVRM10
}
}
}
EditorGUILayout.Separator();
GUI.enabled = backup;
}
@@ -302,7 +301,8 @@ namespace UniVRM10
{
m_logLabel += ex.ToString();
// rethrow
throw;
//throw;
Debug.LogException(ex);
}
}
}

View File

@@ -51,6 +51,7 @@ namespace UniVRM10
case ExpressionPreset.lookLeft: asset.Expression.LookLeft = kv.Value; break;
case ExpressionPreset.lookRight: asset.Expression.LookRight = kv.Value; break;
case ExpressionPreset.neutral: asset.Expression.Neutral = kv.Value; break;
default: break;
}
}

View File

@@ -156,6 +156,11 @@ namespace UniVRM10
public bool TryGetBoneTransform(HumanBodyBones bone, out Transform t)
{
if (Humanoid == null)
{
t = null;
return false;
}
t = Humanoid.GetBoneTransform(bone);
if (t == null)
{