Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3a201af89 | ||
|
|
112a9a1bf2 | ||
|
|
d1e33c25bc | ||
|
|
0a30af0ad2 | ||
|
|
b14849a0b1 | ||
|
|
dcec8797b0 |
@@ -1,13 +1,5 @@
|
||||
# CHANGELOG
|
||||
|
||||
## v0.12.17
|
||||
|
||||
- 动画边界检测的帧率提高到100帧每秒
|
||||
|
||||
## v0.12.16
|
||||
|
||||
- 导出多个时允许自动时长
|
||||
|
||||
## v0.12.15
|
||||
|
||||
- 修复附件类型枚举量字符串大小写问题
|
||||
|
||||
@@ -222,10 +222,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
|
||||
tmpSkeleton.Update(0);
|
||||
tmpSkeleton.UpdateWorldTransform();
|
||||
|
||||
// 按 100 帧每秒计算边框
|
||||
// 按 10 帧每秒计算边框
|
||||
var bounds = getCurrentBounds();
|
||||
float[] _ = [];
|
||||
for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
|
||||
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta)
|
||||
{
|
||||
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h);
|
||||
bounds = bounds.Union(new(x, y, w, h));
|
||||
|
||||
@@ -222,10 +222,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
|
||||
tmpSkeleton.Update(0);
|
||||
tmpSkeleton.UpdateWorldTransform();
|
||||
|
||||
// 按 100 帧每秒计算边框
|
||||
// 按 10 帧每秒计算边框
|
||||
var bounds = getCurrentBounds();
|
||||
float[] _ = [];
|
||||
for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
|
||||
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta)
|
||||
{
|
||||
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
||||
bounds = bounds.Union(new(x, y, w, h));
|
||||
|
||||
@@ -219,10 +219,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
|
||||
tmpSkeleton.Update(0);
|
||||
tmpSkeleton.UpdateWorldTransform();
|
||||
|
||||
// 按 100 帧每秒计算边框
|
||||
// 按 10 帧每秒计算边框
|
||||
var bounds = getCurrentBounds();
|
||||
float[] _ = [];
|
||||
for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
|
||||
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta)
|
||||
{
|
||||
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
||||
bounds = bounds.Union(new(x, y, w, h));
|
||||
|
||||
@@ -217,10 +217,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
|
||||
tmpSkeleton.Update(0);
|
||||
tmpSkeleton.UpdateWorldTransform();
|
||||
|
||||
// 按 100 帧每秒计算边框
|
||||
// 按 10 帧每秒计算边框
|
||||
var bounds = getCurrentBounds();
|
||||
float[] _ = [];
|
||||
for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
|
||||
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta)
|
||||
{
|
||||
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
||||
bounds = bounds.Union(new(x, y, w, h));
|
||||
|
||||
@@ -216,10 +216,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
|
||||
tmpSkeleton.Update(0);
|
||||
tmpSkeleton.UpdateWorldTransform();
|
||||
|
||||
// 按 100 帧每秒计算边框
|
||||
// 按 10 帧每秒计算边框
|
||||
var bounds = getCurrentBounds();
|
||||
float[] _ = [];
|
||||
for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
|
||||
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta)
|
||||
{
|
||||
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
||||
bounds = bounds.Union(new(x, y, w, h));
|
||||
|
||||
@@ -216,10 +216,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
|
||||
//tmpSkeleton.Update(0);
|
||||
tmpSkeleton.UpdateWorldTransform();
|
||||
|
||||
// 按 100 帧每秒计算边框
|
||||
// 按 10 帧每秒计算边框
|
||||
var bounds = getCurrentBounds();
|
||||
float[] _ = [];
|
||||
for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
|
||||
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta)
|
||||
{
|
||||
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
||||
bounds = bounds.Union(new(x, y, w, h));
|
||||
|
||||
@@ -216,10 +216,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
|
||||
tmpSkeleton.Update(0);
|
||||
tmpSkeleton.UpdateWorldTransform(Skeleton.Physics.Update);
|
||||
|
||||
// 按 100 帧每秒计算边框
|
||||
// 按 10 帧每秒计算边框
|
||||
var bounds = getCurrentBounds();
|
||||
float[] _ = [];
|
||||
for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
|
||||
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta)
|
||||
{
|
||||
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
||||
bounds = bounds.Union(new(x, y, w, h));
|
||||
|
||||
@@ -30,6 +30,15 @@ namespace SpineViewer.Spine.SpineExporter
|
||||
/// </summary>
|
||||
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>
|
||||
@@ -84,16 +93,8 @@ namespace SpineViewer.Spine.SpineExporter
|
||||
/// </summary>
|
||||
protected IEnumerable<SFMLImageVideoFrame> GetFrames(SpineObject[] spinesToRender, BackgroundWorker? worker = null)
|
||||
{
|
||||
// 导出单个时取所有模型的所有轨道时长最大值
|
||||
// 导出单个时必须根据 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;
|
||||
int total = (int)(duration * FPS); // 完整帧的数量
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<BaseOutputPath>$(SolutionDir)out</BaseOutputPath>
|
||||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
||||
<Version>0.12.17</Version>
|
||||
<Version>0.12.15</Version>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ApplicationIcon>appicon.ico</ApplicationIcon>
|
||||
|
||||
Reference in New Issue
Block a user