允许导出单个时自动使用所有模型的所有动画最大时长
This commit is contained in:
@@ -64,7 +64,6 @@ namespace SpineViewer.ViewModels.Exporters
|
||||
using var exporter = new CustomFFmpegExporter(_renderer.Resolution.X + _margin * 2, _renderer.Resolution.Y + _margin * 2)
|
||||
{
|
||||
BackgroundColor = new(_backgroundColor.R, _backgroundColor.G, _backgroundColor.B, _backgroundColor.A),
|
||||
Duration = _duration,
|
||||
Fps = _fps,
|
||||
KeepLast = _keepLast,
|
||||
Format = _format,
|
||||
@@ -91,6 +90,7 @@ namespace SpineViewer.ViewModels.Exporters
|
||||
var output = Path.Combine(_outputDir!, filename);
|
||||
|
||||
if (_autoResolution) SetAutoResolutionAnimated(exporter, spines);
|
||||
if (_duration < 0) exporter.Duration = spines.Select(sp => sp.GetAnimationMaxDuration()).DefaultIfEmpty(0).Max();
|
||||
|
||||
exporter.ProgressReporter = (total, done, text) =>
|
||||
{
|
||||
|
||||
@@ -51,7 +51,6 @@ namespace SpineViewer.ViewModels.Exporters
|
||||
using var exporter = new FFmpegVideoExporter(_renderer.Resolution.X + _margin * 2, _renderer.Resolution.Y + _margin * 2)
|
||||
{
|
||||
BackgroundColor = new(_backgroundColor.R, _backgroundColor.G, _backgroundColor.B, _backgroundColor.A),
|
||||
Duration = _duration,
|
||||
Fps = _fps,
|
||||
KeepLast = _keepLast,
|
||||
Format = _format,
|
||||
@@ -76,6 +75,7 @@ namespace SpineViewer.ViewModels.Exporters
|
||||
var output = Path.Combine(_outputDir!, filename);
|
||||
|
||||
if (_autoResolution) SetAutoResolutionAnimated(exporter, spines);
|
||||
if (_duration < 0) exporter.Duration = spines.Select(sp => sp.GetAnimationMaxDuration()).DefaultIfEmpty(0).Max();
|
||||
|
||||
exporter.ProgressReporter = (total, done, text) =>
|
||||
{
|
||||
|
||||
@@ -34,7 +34,6 @@ namespace SpineViewer.ViewModels.Exporters
|
||||
using var exporter = new FrameSequenceExporter(_renderer.Resolution.X + _margin * 2, _renderer.Resolution.Y + _margin * 2)
|
||||
{
|
||||
BackgroundColor = new(_backgroundColor.R, _backgroundColor.G, _backgroundColor.B, _backgroundColor.A),
|
||||
Duration = _duration,
|
||||
Fps = _fps,
|
||||
KeepLast = _keepLast
|
||||
};
|
||||
@@ -55,6 +54,7 @@ namespace SpineViewer.ViewModels.Exporters
|
||||
var output = Path.Combine(_outputDir!, folderName);
|
||||
|
||||
if (_autoResolution) SetAutoResolutionAnimated(exporter, spines);
|
||||
if (_duration < 0) exporter.Duration = spines.Select(sp => sp.GetAnimationMaxDuration()).DefaultIfEmpty(0).Max();
|
||||
|
||||
exporter.ProgressReporter = (total, done, text) =>
|
||||
{
|
||||
|
||||
@@ -18,14 +18,5 @@ namespace SpineViewer.ViewModels.Exporters
|
||||
|
||||
public bool KeepLast { get => _keepLast; set => SetProperty(ref _keepLast, value); }
|
||||
protected bool _keepLast = true;
|
||||
|
||||
public override string? Validate()
|
||||
{
|
||||
if (base.Validate() is string err)
|
||||
return err;
|
||||
if (_exportSingle && _duration <= 0)
|
||||
return AppResource.Str_InvalidDuration;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user