允许导出单个时自动使用所有模型的所有动画最大时长
This commit is contained in:
@@ -39,7 +39,6 @@ namespace SpineViewer.Resources
|
|||||||
public static string Str_OutputDirNotFound => Get<string>("Str_OutputDirNotFound");
|
public static string Str_OutputDirNotFound => Get<string>("Str_OutputDirNotFound");
|
||||||
public static string Str_OutputDirRequired => Get<string>("Str_OutputDirRequired");
|
public static string Str_OutputDirRequired => Get<string>("Str_OutputDirRequired");
|
||||||
public static string Str_InvalidMaxResolution => Get<string>("Str_InvalidMaxResolution");
|
public static string Str_InvalidMaxResolution => Get<string>("Str_InvalidMaxResolution");
|
||||||
public static string Str_InvalidDuration => Get<string>("Str_InvalidDuration");
|
|
||||||
public static string Str_FFmpegFormatRequired => Get<string>("Str_FFmpegFormatRequired");
|
public static string Str_FFmpegFormatRequired => Get<string>("Str_FFmpegFormatRequired");
|
||||||
|
|
||||||
public static string Str_Copied => Get<string>("Str_Copied");
|
public static string Str_Copied => Get<string>("Str_Copied");
|
||||||
|
|||||||
@@ -140,7 +140,6 @@
|
|||||||
<s:String x:Key="Str_OutputDirNotFound">Output Directory Not Found</s:String>
|
<s:String x:Key="Str_OutputDirNotFound">Output Directory Not Found</s:String>
|
||||||
<s:String x:Key="Str_OutputDirRequired">Output folder required for single export</s:String>
|
<s:String x:Key="Str_OutputDirRequired">Output folder required for single export</s:String>
|
||||||
<s:String x:Key="Str_InvalidMaxResolution">Valid max resolution required when using auto resolution</s:String>
|
<s:String x:Key="Str_InvalidMaxResolution">Valid max resolution required when using auto resolution</s:String>
|
||||||
<s:String x:Key="Str_InvalidDuration">Export duration cannot be negative for single export</s:String>
|
|
||||||
<s:String x:Key="Str_FFmpegFormatRequired">FFmpeg export format is required</s:String>
|
<s:String x:Key="Str_FFmpegFormatRequired">FFmpeg export format is required</s:String>
|
||||||
|
|
||||||
<s:String x:Key="Str_ResolutionTooltip">Screen resolution; adjust related parameters in the render settings panel</s:String>
|
<s:String x:Key="Str_ResolutionTooltip">Screen resolution; adjust related parameters in the render settings panel</s:String>
|
||||||
@@ -160,7 +159,7 @@
|
|||||||
<s:String x:Key="Str_ImageQualityTooltip">Range 0–100; only effective for certain formats</s:String>
|
<s:String x:Key="Str_ImageQualityTooltip">Range 0–100; only effective for certain formats</s:String>
|
||||||
|
|
||||||
<s:String x:Key="Str_Duration">Duration</s:String>
|
<s:String x:Key="Str_Duration">Duration</s:String>
|
||||||
<s:String x:Key="Str_ExportDurationTooltip">Export duration; if smaller than 0, each model uses its maximum animation length when exporting individually</s:String>
|
<s:String x:Key="Str_ExportDurationTooltip">Export duration; if less than 0, the maximum duration of all animations in all models will be used during export.</s:String>
|
||||||
|
|
||||||
<s:String x:Key="Str_Fps">FPS</s:String>
|
<s:String x:Key="Str_Fps">FPS</s:String>
|
||||||
<s:String x:Key="Str_KeepLastFrame">Keep Last Frame</s:String>
|
<s:String x:Key="Str_KeepLastFrame">Keep Last Frame</s:String>
|
||||||
|
|||||||
@@ -140,7 +140,6 @@
|
|||||||
<s:String x:Key="Str_OutputDirNotFound">出力フォルダーが存在しません</s:String>
|
<s:String x:Key="Str_OutputDirNotFound">出力フォルダーが存在しません</s:String>
|
||||||
<s:String x:Key="Str_OutputDirRequired">単一エクスポート時は出力フォルダーを指定する必要があります</s:String>
|
<s:String x:Key="Str_OutputDirRequired">単一エクスポート時は出力フォルダーを指定する必要があります</s:String>
|
||||||
<s:String x:Key="Str_InvalidMaxResolution">自動解像度使用時は有効な最大解像度を指定する必要があります</s:String>
|
<s:String x:Key="Str_InvalidMaxResolution">自動解像度使用時は有効な最大解像度を指定する必要があります</s:String>
|
||||||
<s:String x:Key="Str_InvalidDuration">単一エクスポート時、持続時間は0以上である必要があります</s:String>
|
|
||||||
<s:String x:Key="Str_FFmpegFormatRequired">FFmpegエクスポートフォーマットを指定する必要があります</s:String>
|
<s:String x:Key="Str_FFmpegFormatRequired">FFmpegエクスポートフォーマットを指定する必要があります</s:String>
|
||||||
|
|
||||||
<s:String x:Key="Str_ResolutionTooltip">画面解像度。関連パラメーターは画面パネルで調整してください</s:String>
|
<s:String x:Key="Str_ResolutionTooltip">画面解像度。関連パラメーターは画面パネルで調整してください</s:String>
|
||||||
@@ -160,7 +159,7 @@
|
|||||||
<s:String x:Key="Str_ImageQualityTooltip">値の範囲は0-100。一部の画像フォーマットでのみ有効です</s:String>
|
<s:String x:Key="Str_ImageQualityTooltip">値の範囲は0-100。一部の画像フォーマットでのみ有効です</s:String>
|
||||||
|
|
||||||
<s:String x:Key="Str_Duration">時間</s:String>
|
<s:String x:Key="Str_Duration">時間</s:String>
|
||||||
<s:String x:Key="Str_ExportDurationTooltip">エクスポート時間。0未満の場合、個別エクスポート時には各モデルのすべてのトラックアニメーションの最大時間が使用されます</s:String>
|
<s:String x:Key="Str_ExportDurationTooltip">エクスポート時間。0 未満の場合、エクスポート時にすべてのモデルのすべてのアニメーションの最大時間が使用されます。</s:String>
|
||||||
|
|
||||||
<s:String x:Key="Str_Fps">FPS</s:String>
|
<s:String x:Key="Str_Fps">FPS</s:String>
|
||||||
<s:String x:Key="Str_KeepLastFrame">最後のフレームを保持</s:String>
|
<s:String x:Key="Str_KeepLastFrame">最後のフレームを保持</s:String>
|
||||||
|
|||||||
@@ -140,7 +140,6 @@
|
|||||||
<s:String x:Key="Str_OutputDirNotFound">输出文件夹不存在</s:String>
|
<s:String x:Key="Str_OutputDirNotFound">输出文件夹不存在</s:String>
|
||||||
<s:String x:Key="Str_OutputDirRequired">导出单个时必须提供输出文件夹</s:String>
|
<s:String x:Key="Str_OutputDirRequired">导出单个时必须提供输出文件夹</s:String>
|
||||||
<s:String x:Key="Str_InvalidMaxResolution">使用自动分辨率时需要提供有效的最大分辨率</s:String>
|
<s:String x:Key="Str_InvalidMaxResolution">使用自动分辨率时需要提供有效的最大分辨率</s:String>
|
||||||
<s:String x:Key="Str_InvalidDuration">导出单个时导出时长不能为负数</s:String>
|
|
||||||
<s:String x:Key="Str_FFmpegFormatRequired">必须指定 FFmpeg 导出格式</s:String>
|
<s:String x:Key="Str_FFmpegFormatRequired">必须指定 FFmpeg 导出格式</s:String>
|
||||||
|
|
||||||
<s:String x:Key="Str_ResolutionTooltip">画面分辨率,相关参数请在画面参数面板进行调整</s:String>
|
<s:String x:Key="Str_ResolutionTooltip">画面分辨率,相关参数请在画面参数面板进行调整</s:String>
|
||||||
@@ -160,7 +159,7 @@
|
|||||||
<s:String x:Key="Str_ImageQualityTooltip">取值范围 0-100,仅对部分图像格式生效</s:String>
|
<s:String x:Key="Str_ImageQualityTooltip">取值范围 0-100,仅对部分图像格式生效</s:String>
|
||||||
|
|
||||||
<s:String x:Key="Str_Duration">时长</s:String>
|
<s:String x:Key="Str_Duration">时长</s:String>
|
||||||
<s:String x:Key="Str_ExportDurationTooltip">导出时长,如果小于 0,则在逐个导出时每个模型使用各自的所有轨道动画时长最大值</s:String>
|
<s:String x:Key="Str_ExportDurationTooltip">导出时长,如果小于 0,则在导出时使用所有模型所有动画的最大时长</s:String>
|
||||||
|
|
||||||
<s:String x:Key="Str_Fps">帧率</s:String>
|
<s:String x:Key="Str_Fps">帧率</s:String>
|
||||||
<s:String x:Key="Str_KeepLastFrame">保留最后一帧</s:String>
|
<s:String x:Key="Str_KeepLastFrame">保留最后一帧</s:String>
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ namespace SpineViewer.ViewModels.Exporters
|
|||||||
using var exporter = new CustomFFmpegExporter(_renderer.Resolution.X + _margin * 2, _renderer.Resolution.Y + _margin * 2)
|
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),
|
BackgroundColor = new(_backgroundColor.R, _backgroundColor.G, _backgroundColor.B, _backgroundColor.A),
|
||||||
Duration = _duration,
|
|
||||||
Fps = _fps,
|
Fps = _fps,
|
||||||
KeepLast = _keepLast,
|
KeepLast = _keepLast,
|
||||||
Format = _format,
|
Format = _format,
|
||||||
@@ -91,6 +90,7 @@ namespace SpineViewer.ViewModels.Exporters
|
|||||||
var output = Path.Combine(_outputDir!, filename);
|
var output = Path.Combine(_outputDir!, filename);
|
||||||
|
|
||||||
if (_autoResolution) SetAutoResolutionAnimated(exporter, spines);
|
if (_autoResolution) SetAutoResolutionAnimated(exporter, spines);
|
||||||
|
if (_duration < 0) exporter.Duration = spines.Select(sp => sp.GetAnimationMaxDuration()).DefaultIfEmpty(0).Max();
|
||||||
|
|
||||||
exporter.ProgressReporter = (total, done, text) =>
|
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)
|
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),
|
BackgroundColor = new(_backgroundColor.R, _backgroundColor.G, _backgroundColor.B, _backgroundColor.A),
|
||||||
Duration = _duration,
|
|
||||||
Fps = _fps,
|
Fps = _fps,
|
||||||
KeepLast = _keepLast,
|
KeepLast = _keepLast,
|
||||||
Format = _format,
|
Format = _format,
|
||||||
@@ -76,6 +75,7 @@ namespace SpineViewer.ViewModels.Exporters
|
|||||||
var output = Path.Combine(_outputDir!, filename);
|
var output = Path.Combine(_outputDir!, filename);
|
||||||
|
|
||||||
if (_autoResolution) SetAutoResolutionAnimated(exporter, spines);
|
if (_autoResolution) SetAutoResolutionAnimated(exporter, spines);
|
||||||
|
if (_duration < 0) exporter.Duration = spines.Select(sp => sp.GetAnimationMaxDuration()).DefaultIfEmpty(0).Max();
|
||||||
|
|
||||||
exporter.ProgressReporter = (total, done, text) =>
|
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)
|
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),
|
BackgroundColor = new(_backgroundColor.R, _backgroundColor.G, _backgroundColor.B, _backgroundColor.A),
|
||||||
Duration = _duration,
|
|
||||||
Fps = _fps,
|
Fps = _fps,
|
||||||
KeepLast = _keepLast
|
KeepLast = _keepLast
|
||||||
};
|
};
|
||||||
@@ -55,6 +54,7 @@ namespace SpineViewer.ViewModels.Exporters
|
|||||||
var output = Path.Combine(_outputDir!, folderName);
|
var output = Path.Combine(_outputDir!, folderName);
|
||||||
|
|
||||||
if (_autoResolution) SetAutoResolutionAnimated(exporter, spines);
|
if (_autoResolution) SetAutoResolutionAnimated(exporter, spines);
|
||||||
|
if (_duration < 0) exporter.Duration = spines.Select(sp => sp.GetAnimationMaxDuration()).DefaultIfEmpty(0).Max();
|
||||||
|
|
||||||
exporter.ProgressReporter = (total, done, text) =>
|
exporter.ProgressReporter = (total, done, text) =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,14 +18,5 @@ namespace SpineViewer.ViewModels.Exporters
|
|||||||
|
|
||||||
public bool KeepLast { get => _keepLast; set => SetProperty(ref _keepLast, value); }
|
public bool KeepLast { get => _keepLast; set => SetProperty(ref _keepLast, value); }
|
||||||
protected bool _keepLast = true;
|
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