GltfExportSettings.AnimationExporter to gltfExporter argument

This commit is contained in:
ousttrue 2022-02-28 15:34:37 +09:00
parent e19ab9808a
commit 603be0dd2b
3 changed files with 11 additions and 8 deletions

View File

@ -103,10 +103,10 @@ namespace UniGLTF
EditorUtility.DisplayProgressBar("export gltf", path, progress);
try
{
var data = new ExportingGltfData();
Settings.AnimationExporter = new EditorAnimationExporter();
using (var exporter = new gltfExporter(data, Settings, new EditorProgress()))
using (var exporter = new gltfExporter(data, Settings,
progress: new EditorProgress(),
animationExporter: new EditorAnimationExporter()))
{
exporter.Prepare(State.ExportRoot);
exporter.Export(new EditorTextureSerializer());

View File

@ -45,7 +45,5 @@ namespace UniGLTF
/// Keep VertexColor
/// </summary>
public bool KeepVertexColor;
public IAnimationExporter AnimationExporter;
}
}

View File

@ -79,7 +79,10 @@ namespace UniGLTF
m_progress.Report(new ExportProgress("gltfExporter", msg, progress));
}
public gltfExporter(ExportingGltfData data, GltfExportSettings settings, IProgress<ExportProgress> progress = null)
IAnimationExporter m_animationExporter;
public gltfExporter(ExportingGltfData data, GltfExportSettings settings, IProgress<ExportProgress> progress = null,
IAnimationExporter animationExporter = null)
{
_data = data;
@ -97,6 +100,8 @@ namespace UniGLTF
// default
m_settings = new GltfExportSettings();
}
m_animationExporter = animationExporter;
}
GameObject m_tmpParent = null;
@ -328,10 +333,10 @@ namespace UniGLTF
}
#endregion
if (m_settings.AnimationExporter != null)
if (m_animationExporter != null)
{
ReportProgress("Animations", 0.9f);
m_settings.AnimationExporter.Export(_data, Copy, Nodes);
m_animationExporter.Export(_data, Copy, Nodes);
}
ExportExtensions(textureSerializer);