Compare commits

..

7 Commits

Author SHA1 Message Date
ww-rm
acf48cd74d Merge pull request #51 from ww-rm/dev/wf
Release v0.12.17
2025-06-14 20:10:34 +08:00
ww-rm
2fecf4223a 更新至v0.12.17 2025-06-14 20:08:54 +08:00
ww-rm
2953ec44fb update changelog 2025-06-14 20:08:45 +08:00
ww-rm
77399b4524 改善动画边界检测 2025-06-14 20:07:09 +08:00
ww-rm
b34639c383 Merge pull request #48 from ww-rm/dev/wf
Release v0.12.16
2025-06-11 13:43:20 +08:00
ww-rm
c0e2bb81e5 更新至v0.12.16 2025-06-11 13:41:25 +08:00
ww-rm
55ebcc1857 合并导出时也允许自动时长 2025-06-11 13:38:55 +08:00
10 changed files with 32 additions and 25 deletions

View File

@@ -1,5 +1,13 @@
# CHANGELOG # CHANGELOG
## v0.12.17
- 动画边界检测的帧率提高到100帧每秒
## v0.12.16
- 导出多个时允许自动时长
## v0.12.15 ## v0.12.15
- 修复附件类型枚举量字符串大小写问题 - 修复附件类型枚举量字符串大小写问题

View File

@@ -222,10 +222,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
tmpSkeleton.Update(0); tmpSkeleton.Update(0);
tmpSkeleton.UpdateWorldTransform(); tmpSkeleton.UpdateWorldTransform();
// 按 10 帧每秒计算边框 // 按 100 帧每秒计算边框
var bounds = getCurrentBounds(); var bounds = getCurrentBounds();
float[] _ = []; float[] _ = [];
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta) for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
{ {
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h); tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h);
bounds = bounds.Union(new(x, y, w, h)); bounds = bounds.Union(new(x, y, w, h));

View File

@@ -222,10 +222,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
tmpSkeleton.Update(0); tmpSkeleton.Update(0);
tmpSkeleton.UpdateWorldTransform(); tmpSkeleton.UpdateWorldTransform();
// 按 10 帧每秒计算边框 // 按 100 帧每秒计算边框
var bounds = getCurrentBounds(); var bounds = getCurrentBounds();
float[] _ = []; float[] _ = [];
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta) for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
{ {
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _); tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
bounds = bounds.Union(new(x, y, w, h)); bounds = bounds.Union(new(x, y, w, h));

View File

@@ -219,10 +219,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
tmpSkeleton.Update(0); tmpSkeleton.Update(0);
tmpSkeleton.UpdateWorldTransform(); tmpSkeleton.UpdateWorldTransform();
// 按 10 帧每秒计算边框 // 按 100 帧每秒计算边框
var bounds = getCurrentBounds(); var bounds = getCurrentBounds();
float[] _ = []; float[] _ = [];
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta) for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
{ {
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _); tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
bounds = bounds.Union(new(x, y, w, h)); bounds = bounds.Union(new(x, y, w, h));

View File

@@ -217,10 +217,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
tmpSkeleton.Update(0); tmpSkeleton.Update(0);
tmpSkeleton.UpdateWorldTransform(); tmpSkeleton.UpdateWorldTransform();
// 按 10 帧每秒计算边框 // 按 100 帧每秒计算边框
var bounds = getCurrentBounds(); var bounds = getCurrentBounds();
float[] _ = []; float[] _ = [];
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta) for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
{ {
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _); tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
bounds = bounds.Union(new(x, y, w, h)); bounds = bounds.Union(new(x, y, w, h));

View File

@@ -216,10 +216,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
tmpSkeleton.Update(0); tmpSkeleton.Update(0);
tmpSkeleton.UpdateWorldTransform(); tmpSkeleton.UpdateWorldTransform();
// 按 10 帧每秒计算边框 // 按 100 帧每秒计算边框
var bounds = getCurrentBounds(); var bounds = getCurrentBounds();
float[] _ = []; float[] _ = [];
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta) for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
{ {
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _); tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
bounds = bounds.Union(new(x, y, w, h)); bounds = bounds.Union(new(x, y, w, h));

View File

@@ -216,10 +216,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
//tmpSkeleton.Update(0); //tmpSkeleton.Update(0);
tmpSkeleton.UpdateWorldTransform(); tmpSkeleton.UpdateWorldTransform();
// 按 10 帧每秒计算边框 // 按 100 帧每秒计算边框
var bounds = getCurrentBounds(); var bounds = getCurrentBounds();
float[] _ = []; float[] _ = [];
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta) for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
{ {
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _); tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
bounds = bounds.Union(new(x, y, w, h)); bounds = bounds.Union(new(x, y, w, h));

View File

@@ -216,10 +216,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
tmpSkeleton.Update(0); tmpSkeleton.Update(0);
tmpSkeleton.UpdateWorldTransform(Skeleton.Physics.Update); tmpSkeleton.UpdateWorldTransform(Skeleton.Physics.Update);
// 按 10 帧每秒计算边框 // 按 100 帧每秒计算边框
var bounds = getCurrentBounds(); var bounds = getCurrentBounds();
float[] _ = []; float[] _ = [];
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta) for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
{ {
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _); tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
bounds = bounds.Union(new(x, y, w, h)); bounds = bounds.Union(new(x, y, w, h));

View File

@@ -30,15 +30,6 @@ namespace SpineViewer.Spine.SpineExporter
/// </summary> /// </summary>
public bool KeepLast { get; set; } = true; public bool KeepLast { get; set; } = true;
public override string? Validate()
{
if (base.Validate() is string error)
return error;
if (IsExportSingle && Duration < 0)
return Properties.Resources.negativeDuration;
return null;
}
/// <summary> /// <summary>
/// 生成单个模型的帧序列 /// 生成单个模型的帧序列
/// </summary> /// </summary>
@@ -93,8 +84,16 @@ namespace SpineViewer.Spine.SpineExporter
/// </summary> /// </summary>
protected IEnumerable<SFMLImageVideoFrame> GetFrames(SpineObject[] spinesToRender, BackgroundWorker? worker = null) protected IEnumerable<SFMLImageVideoFrame> GetFrames(SpineObject[] spinesToRender, BackgroundWorker? worker = null)
{ {
// 导出单个时必须根据 Duration 决定导出时长 // 导出单个时取所有模型的所有轨道时长最大值
var duration = Duration; var duration = Duration;
if (duration < 0)
{
duration = spinesToRender.Select(
sp => sp.GetTrackIndices().Select(
i => sp.GetAnimationDuration(sp.GetAnimation(i))
).DefaultIfEmpty(0).Max()
).Max();
}
float delta = 1f / FPS; float delta = 1f / FPS;
int total = (int)(duration * FPS); // 完整帧的数量 int total = (int)(duration * FPS); // 完整帧的数量

View File

@@ -7,7 +7,7 @@
<TargetFramework>net8.0-windows</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<BaseOutputPath>$(SolutionDir)out</BaseOutputPath> <BaseOutputPath>$(SolutionDir)out</BaseOutputPath>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion> <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<Version>0.12.15</Version> <Version>0.12.17</Version>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>appicon.ico</ApplicationIcon> <ApplicationIcon>appicon.ico</ApplicationIcon>