mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-14 14:59:43 -05:00
VRMExportSettings.KeepAnimation
This commit is contained in:
@@ -19,7 +19,7 @@ namespace UniGLTF
|
||||
{
|
||||
clips = AnimationExporter.GetAnimationClips(animator);
|
||||
}
|
||||
else if (animation != null)
|
||||
if (animation != null)
|
||||
{
|
||||
clips = AnimationExporter.GetAnimationClips(animation);
|
||||
}
|
||||
|
||||
@@ -223,7 +223,9 @@ namespace VRM
|
||||
// 出力
|
||||
var sw = System.Diagnostics.Stopwatch.StartNew();
|
||||
var data = new UniGLTF.ExportingGltfData();
|
||||
using (var exporter = new VRMExporter(data, settings.MeshExportSettings))
|
||||
var gltfExportSettings = settings.GltfExportSettings;
|
||||
using (var exporter = new VRMExporter(data, gltfExportSettings,
|
||||
settings.KeepAnimation ? new EditorAnimationExporter() : null))
|
||||
{
|
||||
exporter.Prepare(target);
|
||||
exporter.Export(new EditorTextureSerializer());
|
||||
|
||||
@@ -47,5 +47,9 @@ namespace VRM
|
||||
[LangMsg(Languages.ja, "頂点カラーの自動削除をしない。")]
|
||||
[LangMsg(Languages.en, "Do not automatically delete vertex colors.")]
|
||||
KEEP_VERTEX_COLOR,
|
||||
|
||||
[LangMsg(Languages.ja, "glTF Animationをエクスポートする。")]
|
||||
[LangMsg(Languages.en, "export glTF animation.")]
|
||||
EXPORT_GLTF_ANIMATION,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,13 @@ namespace VRM
|
||||
[Tooltip("Keep vertex color attribute")]
|
||||
public bool KeepVertexColor = false;
|
||||
|
||||
public GltfExportSettings MeshExportSettings => new GltfExportSettings
|
||||
/// <summary>
|
||||
/// Export時にAnimationを落とさない。特別な用途で使えるように敢えて残す設定
|
||||
/// </summary>
|
||||
[Tooltip("Keep animation")]
|
||||
public bool KeepAnimation = false;
|
||||
|
||||
public GltfExportSettings GltfExportSettings => new GltfExportSettings
|
||||
{
|
||||
UseSparseAccessorForMorphTarget = UseSparseAccessor,
|
||||
ExportOnlyBlendShapePosition = OnlyBlendshapePosition,
|
||||
|
||||
@@ -54,6 +54,7 @@ namespace VRM
|
||||
m_checkbox_list.Add(new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.ReduceBlendshapeClip)), VRMExportOptions.BLENDSHAPE_EXCLUDE_UNKNOWN));
|
||||
m_checkbox_list.Add(new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.DivideVertexBuffer)), VRMExportOptions.DIVIDE_VERTEX_BUFFER));
|
||||
m_checkbox_list.Add(new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.KeepVertexColor)), VRMExportOptions.KEEP_VERTEX_COLOR));
|
||||
m_checkbox_list.Add(new CheckBoxProp(serializedObject.FindProperty(nameof(VRMExportSettings.KeepAnimation)), VRMExportOptions.EXPORT_GLTF_ANIMATION));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace VRM
|
||||
|
||||
protected override void OnLayout()
|
||||
{
|
||||
m_meshes.SetRoot(State.ExportRoot, m_settings.MeshExportSettings, new VRMBlendShapeExportFilter(State.ExportRoot, m_settings));
|
||||
m_meshes.SetRoot(State.ExportRoot, m_settings.GltfExportSettings, new VRMBlendShapeExportFilter(State.ExportRoot, m_settings));
|
||||
}
|
||||
|
||||
static bool s_foldT = true;
|
||||
|
||||
@@ -25,7 +25,8 @@ namespace VRM
|
||||
|
||||
public readonly VRM.glTF_VRM_extensions VRM = new glTF_VRM_extensions();
|
||||
|
||||
public VRMExporter(ExportingGltfData data, GltfExportSettings exportSettings) : base(data, exportSettings)
|
||||
public VRMExporter(ExportingGltfData data, GltfExportSettings exportSettings, IAnimationExporter animationExporter = null) : base(
|
||||
data, exportSettings, animationExporter: animationExporter)
|
||||
{
|
||||
if (exportSettings == null || exportSettings.InverseAxis != Vrm0xSpecificationInverseAxis)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user