Skip to content

Commit

Permalink
Merge pull request #2181 from FujiSunflower/master
Browse files Browse the repository at this point in the history
Simplified some GUI
  • Loading branch information
ousttrue authored Nov 1, 2023
2 parents e896c6c + 48708b8 commit c4fbd48
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 24 deletions.
39 changes: 19 additions & 20 deletions Assets/UniGLTF/Editor/UniGLTF/ExportDialog/ExportDialogBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,33 +144,32 @@ void EndGUI()
//
// 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);
}

Expand Down
8 changes: 4 additions & 4 deletions Assets/VRM10/Editor/Vrm10ExportDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ public class VRM10ExportDialog : ExportDialogBase
{
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();
}

Expand Down Expand Up @@ -203,7 +202,7 @@ protected override bool DoGUI(bool isValid)
}
}
}

EditorGUILayout.Separator();
GUI.enabled = backup;
}

Expand Down Expand Up @@ -302,7 +301,8 @@ protected override void ExportPath(string path)
{
m_logLabel += ex.ToString();
// rethrow
throw;
//throw;
Debug.LogException(ex);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Assets/VRM10/Editor/Vrm10InstanceEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ static VRM10Object CreateAsset(string path, Dictionary<ExpressionPreset, VRM10Ex
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;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ private void OnDrawGizmosSelected()

public bool TryGetBoneTransform(HumanBodyBones bone, out Transform t)
{
if (Humanoid == null)
{
t = null;
return false;
}
t = Humanoid.GetBoneTransform(bone);
if (t == null)
{
Expand Down

0 comments on commit c4fbd48

Please sign in to comment.