mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-24 23:18:04 -05:00
VRM10ExportSettings.cs
This commit is contained in:
parent
ab0e3a4b80
commit
5beba7c647
|
|
@ -336,6 +336,7 @@ namespace VRM
|
|||
|
||||
if (!proxy)
|
||||
{
|
||||
EditorGUILayout.HelpBox("no BlendShapeProxy", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
var avatar = proxy.BlendShapeAvatar;
|
||||
|
|
|
|||
31
Assets/VRM10/Editor/VRM10ExportSettings.cs
Normal file
31
Assets/VRM10/Editor/VRM10ExportSettings.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using UniGLTF;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UniVRM10
|
||||
{
|
||||
[Serializable]
|
||||
public class VRM10ExportSettings : ScriptableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// エクスポート時にBlendShapeClipから参照されないBlendShapeを削除する
|
||||
/// </summary>
|
||||
[Tooltip("Remove blendshape that is not used from BlendShapeClip")]
|
||||
public bool ReduceBlendshape = false;
|
||||
|
||||
/// <summary>
|
||||
/// skip if BlendShapeClip.Preset == Unknown
|
||||
/// </summary>
|
||||
[Tooltip("Remove blendShapeClip that preset is Unknown")]
|
||||
public bool ReduceBlendshapeClip = false;
|
||||
|
||||
public MeshExportSettings MeshExportSettings => new MeshExportSettings
|
||||
{
|
||||
UseSparseAccessorForMorphTarget = true,
|
||||
ExportOnlyBlendShapePosition = true,
|
||||
DivideVertexBuffer = true,
|
||||
};
|
||||
|
||||
public GameObject Root { get; set; }
|
||||
}
|
||||
}
|
||||
11
Assets/VRM10/Editor/VRM10ExportSettings.cs.meta
Normal file
11
Assets/VRM10/Editor/VRM10ExportSettings.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fbbce5097a7261648b99437896210af8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -31,7 +31,10 @@ namespace UniVRM10
|
|||
}
|
||||
Tabs _tab;
|
||||
|
||||
// export settings
|
||||
|
||||
VRM10ExportSettings m_settings;
|
||||
Editor m_settingsInspector;
|
||||
|
||||
|
||||
MeshExportValidator m_meshes;
|
||||
Editor m_meshesInspector;
|
||||
|
|
@ -72,6 +75,9 @@ namespace UniVRM10
|
|||
m_tmpMeta = ScriptableObject.CreateInstance<VRM10MetaObject>();
|
||||
m_tmpMeta.Authors = new List<string> { "" };
|
||||
|
||||
m_settings = ScriptableObject.CreateInstance<VRM10ExportSettings>();
|
||||
m_settingsInspector = Editor.CreateEditor(m_settings);
|
||||
|
||||
m_meshes = ScriptableObject.CreateInstance<MeshExportValidator>();
|
||||
m_meshesInspector = Editor.CreateEditor(m_meshes);
|
||||
|
||||
|
|
@ -105,6 +111,9 @@ namespace UniVRM10
|
|||
|
||||
protected override void Clear()
|
||||
{
|
||||
// m_settingsInspector
|
||||
UnityEditor.Editor.DestroyImmediate(m_settingsInspector);
|
||||
m_settingsInspector = null;
|
||||
// m_meshesInspector
|
||||
UnityEditor.Editor.DestroyImmediate(m_meshesInspector);
|
||||
m_meshesInspector = null;
|
||||
|
|
@ -112,11 +121,18 @@ namespace UniVRM10
|
|||
Meta = null;
|
||||
ScriptableObject.DestroyImmediate(m_tmpMeta);
|
||||
m_tmpMeta = null;
|
||||
// m_settings
|
||||
ScriptableObject.DestroyImmediate(m_settings);
|
||||
m_settings = null;
|
||||
// m_meshes
|
||||
ScriptableObject.DestroyImmediate(m_meshes);
|
||||
m_meshes = null;
|
||||
}
|
||||
|
||||
protected override IEnumerable<Validator> ValidatorFactory()
|
||||
{
|
||||
HumanoidValidator.MeshInformations = m_meshes.Meshes;
|
||||
// HumanoidValidator.EnableFreeze = m_settings.PoseFreeze;
|
||||
|
||||
yield return HierarchyValidator.Validate;
|
||||
if (!State.ExportRoot)
|
||||
|
|
@ -242,7 +258,7 @@ namespace UniVRM10
|
|||
break;
|
||||
|
||||
case Tabs.ExportSettings:
|
||||
// m_settingsInspector.OnInspectorGUI();
|
||||
m_settingsInspector.OnInspectorGUI();
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user