mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-25 07:28:51 -05:00
Separate VRMExportOptions.cs
This commit is contained in:
parent
89a346d0fe
commit
27f2d684a6
47
Assets/VRM/Editor/Format/VRMExportOptions.cs
Normal file
47
Assets/VRM/Editor/Format/VRMExportOptions.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
using UniGLTF.M17N;
|
||||
|
||||
namespace VRM
|
||||
{
|
||||
public enum VRMExportOptions
|
||||
{
|
||||
[LangMsg(Languages.ja, "エクスポート時に強制的にT-Pose化する。これを使わずに手動でT-Poseを作っても問題ありません")]
|
||||
[LangMsg(Languages.en, "Force T-Pose before export. Manually making T-Pose for model without enabling this is ok")]
|
||||
FORCE_T_POSE,
|
||||
|
||||
[LangMsg(Languages.ja, "エクスポート時に正規化(ヒエラルキーから回転と拡大縮小を取り除くためにベイク)する")]
|
||||
[LangMsg(Languages.en, "Model's normalization (bake to remove roation and scaling from the hierarchy)")]
|
||||
NORMALIZE,
|
||||
|
||||
[LangMsg(Languages.ja, "エクスポート時に新しいJsonSerializerを使う")]
|
||||
[LangMsg(Languages.en, "The new version of JsonSerializer for model export")]
|
||||
USE_GENERATED_SERIALIZER,
|
||||
|
||||
[LangMsg(Languages.ja, "BlendShapeの容量を GLTF の Sparse Accessor 機能で削減する。修正中: UniGLTF以外でロードできません")]
|
||||
[LangMsg(Languages.en, "BlendShape size can be reduced by using Sparse Accessor")]
|
||||
BLENDSHAPE_USE_SPARSE,
|
||||
|
||||
[LangMsg(Languages.ja, "BlendShapeClipのエクスポートに法線とTangentを含めない。UniVRM-0.53 以前ではロードがエラーになるのに注意してください")]
|
||||
[LangMsg(Languages.en, "BlendShape's Normal and Tangent will not be exported. Be aware that errors may occur during import if the model is made by UniVRM-0.53 or earlier versions")]
|
||||
BLENDSHAPE_EXCLUDE_NORMAL_AND_TANGENT,
|
||||
|
||||
[LangMsg(Languages.ja, "BlendShapeClipから参照されないBlendShapeをエクスポートに含めない")]
|
||||
[LangMsg(Languages.en, "BlendShapes that are not referenced by BlendShapeClips will not be exported")]
|
||||
BLENDSHAPE_ONLY_CLIP_USE,
|
||||
|
||||
[LangMsg(Languages.ja, "BlendShapeClip.Preset == Unknown のBlendShapeClipをエクスポートに含めない")]
|
||||
[LangMsg(Languages.en, "BlendShapeClip will not be exported if BlendShapeClip.Preset == Unknown")]
|
||||
BLENDSHAPE_EXCLUDE_UNKNOWN,
|
||||
|
||||
[LangMsg(Languages.ja, "エクスポートに頂点カラーを含めない")]
|
||||
[LangMsg(Languages.en, "Vertex color will not be exported")]
|
||||
REMOVE_VERTEX_COLOR,
|
||||
|
||||
[LangMsg(Languages.ja, "T-Pose にする")]
|
||||
[LangMsg(Languages.en, "Make T-Pose")]
|
||||
DO_TPOSE,
|
||||
|
||||
[LangMsg(Languages.ja, "頂点バッファをsubmeshで分割する。GLTF互換性のため。UniVRM-0.72 からロードできる。")]
|
||||
[LangMsg(Languages.en, "Divide vertex buffer by submesh。For more gltf compatibility。UniVRM-0.72 or later can load.")]
|
||||
DIVIDE_VERTEX_BUFFER,
|
||||
}
|
||||
}
|
||||
11
Assets/VRM/Editor/Format/VRMExportOptions.cs.meta
Normal file
11
Assets/VRM/Editor/Format/VRMExportOptions.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c00e4ca5b52c8c54bb0565edadf6c7f1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -20,7 +20,7 @@ namespace VRM
|
|||
Description = desc;
|
||||
}
|
||||
|
||||
public CheckBoxProp(SerializedProperty property, Options desc) : this(property, () => Msg(desc))
|
||||
public CheckBoxProp(SerializedProperty property, VRMExportOptions desc) : this(property, () => Msg(desc))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -43,62 +43,20 @@ namespace VRM
|
|||
CheckBoxProp m_reduceBlendShapeClip;
|
||||
CheckBoxProp m_divideVertexBuffer;
|
||||
|
||||
static string Msg(Options key)
|
||||
static string Msg(VRMExportOptions key)
|
||||
{
|
||||
return LanguageGetter.Msg(key);
|
||||
}
|
||||
|
||||
public enum Options
|
||||
{
|
||||
[LangMsg(Languages.ja, "エクスポート時に強制的にT-Pose化する。これを使わずに手動でT-Poseを作っても問題ありません")]
|
||||
[LangMsg(Languages.en, "Force T-Pose before export. Manually making T-Pose for model without enabling this is ok")]
|
||||
FORCE_T_POSE,
|
||||
|
||||
[LangMsg(Languages.ja, "エクスポート時に正規化(ヒエラルキーから回転と拡大縮小を取り除くためにベイク)する")]
|
||||
[LangMsg(Languages.en, "Model's normalization (bake to remove roation and scaling from the hierarchy)")]
|
||||
NORMALIZE,
|
||||
|
||||
[LangMsg(Languages.ja, "エクスポート時に新しいJsonSerializerを使う")]
|
||||
[LangMsg(Languages.en, "The new version of JsonSerializer for model export")]
|
||||
USE_GENERATED_SERIALIZER,
|
||||
|
||||
[LangMsg(Languages.ja, "BlendShapeの容量を GLTF の Sparse Accessor 機能で削減する。修正中: UniGLTF以外でロードできません")]
|
||||
[LangMsg(Languages.en, "BlendShape size can be reduced by using Sparse Accessor")]
|
||||
BLENDSHAPE_USE_SPARSE,
|
||||
|
||||
[LangMsg(Languages.ja, "BlendShapeClipのエクスポートに法線とTangentを含めない。UniVRM-0.53 以前ではロードがエラーになるのに注意してください")]
|
||||
[LangMsg(Languages.en, "BlendShape's Normal and Tangent will not be exported. Be aware that errors may occur during import if the model is made by UniVRM-0.53 or earlier versions")]
|
||||
BLENDSHAPE_EXCLUDE_NORMAL_AND_TANGENT,
|
||||
|
||||
[LangMsg(Languages.ja, "BlendShapeClipから参照されないBlendShapeをエクスポートに含めない")]
|
||||
[LangMsg(Languages.en, "BlendShapes that are not referenced by BlendShapeClips will not be exported")]
|
||||
BLENDSHAPE_ONLY_CLIP_USE,
|
||||
|
||||
[LangMsg(Languages.ja, "BlendShapeClip.Preset == Unknown のBlendShapeClipをエクスポートに含めない")]
|
||||
[LangMsg(Languages.en, "BlendShapeClip will not be exported if BlendShapeClip.Preset == Unknown")]
|
||||
BLENDSHAPE_EXCLUDE_UNKNOWN,
|
||||
|
||||
[LangMsg(Languages.ja, "エクスポートに頂点カラーを含めない")]
|
||||
[LangMsg(Languages.en, "Vertex color will not be exported")]
|
||||
REMOVE_VERTEX_COLOR,
|
||||
|
||||
[LangMsg(Languages.ja, "T-Pose にする")]
|
||||
[LangMsg(Languages.en, "Make T-Pose")]
|
||||
DO_TPOSE,
|
||||
|
||||
[LangMsg(Languages.ja, "頂点バッファをsubmeshで分割する。GLTF互換性のため。UniVRM-0.72 からロードできる。")]
|
||||
[LangMsg(Languages.en, "Divide vertex buffer by submesh。For more gltf compatibility。UniVRM-0.72 or later can load.")]
|
||||
DIVIDE_VERTEX_BUFFER,
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
m_poseFreeze = new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.PoseFreeze)), Options.NORMALIZE);
|
||||
m_useSparseAccessor = new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.UseSparseAccessor)), Options.BLENDSHAPE_USE_SPARSE);
|
||||
m_onlyBlendShapePosition = new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.OnlyBlendshapePosition)), Options.BLENDSHAPE_EXCLUDE_NORMAL_AND_TANGENT);
|
||||
m_reduceBlendShape = new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.ReduceBlendshape)), Options.BLENDSHAPE_ONLY_CLIP_USE);
|
||||
m_reduceBlendShapeClip = new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.ReduceBlendshapeClip)), Options.BLENDSHAPE_EXCLUDE_UNKNOWN);
|
||||
m_divideVertexBuffer = new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.DivideVertexBuffer)), Options.DIVIDE_VERTEX_BUFFER);
|
||||
m_poseFreeze = new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.PoseFreeze)), VRMExportOptions.NORMALIZE);
|
||||
m_useSparseAccessor = new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.UseSparseAccessor)), VRMExportOptions.BLENDSHAPE_USE_SPARSE);
|
||||
m_onlyBlendShapePosition = new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.OnlyBlendshapePosition)), VRMExportOptions.BLENDSHAPE_EXCLUDE_NORMAL_AND_TANGENT);
|
||||
m_reduceBlendShape = new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.ReduceBlendshape)), VRMExportOptions.BLENDSHAPE_ONLY_CLIP_USE);
|
||||
m_reduceBlendShapeClip = new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.ReduceBlendshapeClip)), VRMExportOptions.BLENDSHAPE_EXCLUDE_UNKNOWN);
|
||||
m_divideVertexBuffer = new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.DivideVertexBuffer)), VRMExportOptions.DIVIDE_VERTEX_BUFFER);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ namespace VRM
|
|||
//
|
||||
// T-Pose
|
||||
//
|
||||
if (GUILayout.Button(VRMExportSettingsEditor.Options.DO_TPOSE.Msg()))
|
||||
if (GUILayout.Button(VRMExportOptions.DO_TPOSE.Msg()))
|
||||
{
|
||||
if (State.ExportRoot != null)
|
||||
{
|
||||
|
|
@ -247,7 +247,7 @@ namespace VRM
|
|||
}
|
||||
}
|
||||
|
||||
if (GUILayout.Button(VRMExportSettingsEditor.Options.DO_TPOSE.Msg() + "(unity internal)"))
|
||||
if (GUILayout.Button(VRMExportOptions.DO_TPOSE.Msg() + "(unity internal)"))
|
||||
{
|
||||
if (State.ExportRoot != null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user