diff --git a/SpineViewer/Resources/AppResource.cs b/SpineViewer/Resources/AppResource.cs index 4d1dbf4..7080b3f 100644 --- a/SpineViewer/Resources/AppResource.cs +++ b/SpineViewer/Resources/AppResource.cs @@ -39,7 +39,6 @@ namespace SpineViewer.Resources public static string Str_OutputDirNotFound => Get("Str_OutputDirNotFound"); public static string Str_OutputDirRequired => Get("Str_OutputDirRequired"); public static string Str_InvalidMaxResolution => Get("Str_InvalidMaxResolution"); - public static string Str_InvalidDuration => Get("Str_InvalidDuration"); public static string Str_FFmpegFormatRequired => Get("Str_FFmpegFormatRequired"); public static string Str_Copied => Get("Str_Copied"); diff --git a/SpineViewer/Resources/Strings/en.xaml b/SpineViewer/Resources/Strings/en.xaml index 0a8f0c3..411d34d 100644 --- a/SpineViewer/Resources/Strings/en.xaml +++ b/SpineViewer/Resources/Strings/en.xaml @@ -140,7 +140,6 @@ Output Directory Not Found Output folder required for single export Valid max resolution required when using auto resolution - Export duration cannot be negative for single export FFmpeg export format is required Screen resolution; adjust related parameters in the render settings panel @@ -160,7 +159,7 @@ Range 0–100; only effective for certain formats Duration - Export duration; if smaller than 0, each model uses its maximum animation length when exporting individually + Export duration; if less than 0, the maximum duration of all animations in all models will be used during export. FPS Keep Last Frame diff --git a/SpineViewer/Resources/Strings/ja.xaml b/SpineViewer/Resources/Strings/ja.xaml index a359d64..52c3263 100644 --- a/SpineViewer/Resources/Strings/ja.xaml +++ b/SpineViewer/Resources/Strings/ja.xaml @@ -140,7 +140,6 @@ 出力フォルダーが存在しません 単一エクスポート時は出力フォルダーを指定する必要があります 自動解像度使用時は有効な最大解像度を指定する必要があります - 単一エクスポート時、持続時間は0以上である必要があります FFmpegエクスポートフォーマットを指定する必要があります 画面解像度。関連パラメーターは画面パネルで調整してください @@ -160,7 +159,7 @@ 値の範囲は0-100。一部の画像フォーマットでのみ有効です 時間 - エクスポート時間。0未満の場合、個別エクスポート時には各モデルのすべてのトラックアニメーションの最大時間が使用されます + エクスポート時間。0 未満の場合、エクスポート時にすべてのモデルのすべてのアニメーションの最大時間が使用されます。 FPS 最後のフレームを保持 diff --git a/SpineViewer/Resources/Strings/zh.xaml b/SpineViewer/Resources/Strings/zh.xaml index 951048c..dd75549 100644 --- a/SpineViewer/Resources/Strings/zh.xaml +++ b/SpineViewer/Resources/Strings/zh.xaml @@ -140,7 +140,6 @@ 输出文件夹不存在 导出单个时必须提供输出文件夹 使用自动分辨率时需要提供有效的最大分辨率 - 导出单个时导出时长不能为负数 必须指定 FFmpeg 导出格式 画面分辨率,相关参数请在画面参数面板进行调整 @@ -160,7 +159,7 @@ 取值范围 0-100,仅对部分图像格式生效 时长 - 导出时长,如果小于 0,则在逐个导出时每个模型使用各自的所有轨道动画时长最大值 + 导出时长,如果小于 0,则在导出时使用所有模型所有动画的最大时长 帧率 保留最后一帧 diff --git a/SpineViewer/ViewModels/Exporters/CustomFFmpegExporterViewModel.cs b/SpineViewer/ViewModels/Exporters/CustomFFmpegExporterViewModel.cs index 2ea1cae..085d426 100644 --- a/SpineViewer/ViewModels/Exporters/CustomFFmpegExporterViewModel.cs +++ b/SpineViewer/ViewModels/Exporters/CustomFFmpegExporterViewModel.cs @@ -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) => { diff --git a/SpineViewer/ViewModels/Exporters/FFmpegVideoExporterViewModel.cs b/SpineViewer/ViewModels/Exporters/FFmpegVideoExporterViewModel.cs index 30eec0a..3ed8111 100644 --- a/SpineViewer/ViewModels/Exporters/FFmpegVideoExporterViewModel.cs +++ b/SpineViewer/ViewModels/Exporters/FFmpegVideoExporterViewModel.cs @@ -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) => { diff --git a/SpineViewer/ViewModels/Exporters/FrameSequenceExporterViewModel.cs b/SpineViewer/ViewModels/Exporters/FrameSequenceExporterViewModel.cs index d692379..81483ac 100644 --- a/SpineViewer/ViewModels/Exporters/FrameSequenceExporterViewModel.cs +++ b/SpineViewer/ViewModels/Exporters/FrameSequenceExporterViewModel.cs @@ -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) => { diff --git a/SpineViewer/ViewModels/Exporters/VideoExporterViewModel.cs b/SpineViewer/ViewModels/Exporters/VideoExporterViewModel.cs index fa6e9b2..43353ec 100644 --- a/SpineViewer/ViewModels/Exporters/VideoExporterViewModel.cs +++ b/SpineViewer/ViewModels/Exporters/VideoExporterViewModel.cs @@ -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; - } } }