UniVRM/Assets/VRM10/Editor/MeshUtility/Vrm10MeshUtilityDialog.cs
2023-11-21 19:36:40 +09:00

108 lines
3.8 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEngine;
using UnityEditor;
using UniGLTF;
using UniGLTF.M17N;
namespace UniVRM10
{
public class Vrm10MeshUtilityDialog : UniGLTF.MeshUtility.MeshUtilityDialog
{
public new const string MENU_NAME = "VRM 1.0 MeshUtility";
public new static void OpenWindow()
{
var window =
(Vrm10MeshUtilityDialog)EditorWindow.GetWindow(typeof(Vrm10MeshUtilityDialog));
window.titleContent = new GUIContent(MENU_NAME);
window.Show();
}
protected override void Validate()
{
base.Validate();
if (_exportTarget.GetComponent<Vrm10Instance>() == null)
{
_validations.Add(Validation.Error("target is not vrm1"));
return;
}
}
Vrm10MeshUtility _meshUtil;
Vrm10MeshUtility Vrm10MeshUtility
{
get
{
if (_meshUtil == null)
{
_meshUtil = new Vrm10MeshUtility();
}
return _meshUtil;
}
}
protected override UniGLTF.MeshUtility.GltfMeshUtility MeshUtility => Vrm10MeshUtility;
Vrm10MeshIntegrationTab _integrationTab;
protected override UniGLTF.MeshUtility.MeshIntegrationTab MeshIntegration
{
get
{
if (_integrationTab == null)
{
_integrationTab = new Vrm10MeshIntegrationTab(this, Vrm10MeshUtility);
}
return _integrationTab;
}
}
protected override bool MeshIntegrateGui()
{
var firstPerson = ToggleIsModified("FirstPerson == AUTO の生成", ref MeshUtility.GenerateMeshForFirstPersonAuto);
var mod = base.MeshIntegrateGui();
return firstPerson || mod;
}
protected override void DialogMessage()
{
EditorGUILayout.HelpBox(Message.MESH_UTILITY.Msg(), MessageType.Info);
}
enum Message
{
[LangMsg(Languages.ja, @"(VRM-1.0専用) 凍結 > 統合 > 分割 という一連の処理を実行します。
[凍結]
- Mesh
- BlendShape Mesh
- VRM-1.0
- VRM-1.0
- HumanoidAvatar
- Expression, SpringBone, Constraint
[統合]
- MeshRenderer SkinnedMeshRenderer SkinnedMeshRenderer
- VRM FirstPerson (BOTH, FirstPerson, ThirdPerson)
- FirstPerson=AUTO
- Mesh ThirdPerson FirstPersonOnly
[分割]
- BlendShape
- BOTH, FirstPerson, ThirdPerson x 2 6Mesh 3Mesh
[Scene と Prefab]
Scene Prefab
(Scene/Runtime)
- UNDO可能
- Asset Unityを再起動すると Mesh Asset
(Prefab/Editor)
- prefab Asset
- Asset
- Undo
")]
[LangMsg(Languages.en, @"TODO
")]
MESH_UTILITY,
}
}
}