Compare commits

...

13 Commits

Author SHA1 Message Date
ww-rm
479a5e4da9 更新至v0.11.3 2025-03-26 20:33:48 +08:00
ww-rm
4829454877 update changelog 2025-03-26 20:33:31 +08:00
ww-rm
28664f6387 增加隐藏控制 2025-03-26 20:30:55 +08:00
ww-rm
1a08a23a9c 批量添加完成自动选中最后一项 2025-03-26 20:24:27 +08:00
ww-rm
16f344ff1b 增加纹理调试 2025-03-26 19:55:43 +08:00
ww-rm
693ce0e2e8 调整属性分组和注释 2025-03-26 19:52:29 +08:00
ww-rm
e6f533ea65 优化属性分组显示顺序 2025-03-26 18:54:35 +08:00
ww-rm
fcc21d63b0 优化排列顺序 2025-03-26 18:39:30 +08:00
ww-rm
afc0ffcb67 Merge branch 'main' of github.com:ww-rm/SpineViewer 2025-03-26 18:25:56 +08:00
ww-rm
9ffb9840e1 去除限制 2025-03-26 18:25:48 +08:00
ww-rm
4766ccf1b6 互换模型和画面参数面板位置 2025-03-26 18:23:59 +08:00
ww-rm
16b75c80a3 Update README.en.md 2025-03-26 17:00:08 +08:00
ww-rm
880f063046 优化分割条可感知宽度 2025-03-26 16:20:12 +08:00
21 changed files with 246 additions and 171 deletions

View File

@@ -1,5 +1,12 @@
# CHANGELOG # CHANGELOG
## v0.11.3
- 增加模型隐藏设置属性
- 加宽面板分割条 (4 -> 8 像素)
- 优化属性面板分组显示
- 增加调试纹理
## v0.11.2 ## v0.11.2
- 增加皮肤切换 - 增加皮肤切换

View File

@@ -1,7 +1,3 @@
Below is the translated English version of your README:
---
# [SpineViewer](https://github.com/ww-rm/SpineViewer) # [SpineViewer](https://github.com/ww-rm/SpineViewer)
[![Build and Release](https://github.com/ww-rm/SpineViewer/actions/workflows/dotnet-desktop.yml/badge.svg)](https://github.com/ww-rm/SpineViewer/actions/workflows/dotnet-desktop.yml) [![Build and Release](https://github.com/ww-rm/SpineViewer/actions/workflows/dotnet-desktop.yml/badge.svg)](https://github.com/ww-rm/SpineViewer/actions/workflows/dotnet-desktop.yml)

View File

@@ -12,7 +12,6 @@ using SpineViewer.Spine;
using System.Reflection; using System.Reflection;
using System.Diagnostics; using System.Diagnostics;
using System.Collections.Specialized; using System.Collections.Specialized;
namespace SpineViewer.Controls namespace SpineViewer.Controls
{ {
public partial class SpineListView : UserControl public partial class SpineListView : UserControl
@@ -166,14 +165,20 @@ namespace SpineViewer.Controls
worker.ReportProgress((int)((i + 1) * 100.0) / totalCount, $"已处理 {i + 1}/{totalCount}"); worker.ReportProgress((int)((i + 1) * 100.0) / totalCount, $"已处理 {i + 1}/{totalCount}");
} }
// 选中最后一项
listView.Invoke(() =>
{
if (listView.Items.Count > 0)
{
listView.SelectedIndices.Clear();
listView.SelectedIndices.Add(listView.Items.Count - 1);
}
});
if (error > 0) if (error > 0)
{
Program.Logger.Warn("Batch load {} successfully, {} failed", success, error); Program.Logger.Warn("Batch load {} successfully, {} failed", success, error);
}
else else
{
Program.Logger.Info("{} skel loaded successfully", success); Program.Logger.Info("{} skel loaded successfully", success);
}
Program.LogCurrentMemoryUsage(); Program.LogCurrentMemoryUsage();
} }

View File

@@ -54,32 +54,32 @@ namespace SpineViewer.Controls
private class PreviewerProperty(SpinePreviewer previewer) private class PreviewerProperty(SpinePreviewer previewer)
{ {
[TypeConverter(typeof(SizeConverter))] [TypeConverter(typeof(SizeConverter))]
[Category("导出"), DisplayName("分辨率")] [Category("[0] "), DisplayName("")]
public Size Resolution { get => previewer.Resolution; set => previewer.Resolution = value; } public Size Resolution { get => previewer.Resolution; set => previewer.Resolution = value; }
[TypeConverter(typeof(PointFConverter))] [TypeConverter(typeof(PointFConverter))]
[Category("导出"), DisplayName("画面中心点")] [Category("[0] "), DisplayName("")]
public PointF Center { get => previewer.Center; set => previewer.Center = value; } public PointF Center { get => previewer.Center; set => previewer.Center = value; }
[Category("导出"), DisplayName("缩放")] [Category("[0] "), DisplayName("")]
public float Zoom { get => previewer.Zoom; set => previewer.Zoom = value; } public float Zoom { get => previewer.Zoom; set => previewer.Zoom = value; }
[Category("导出"), DisplayName("旋转")] [Category("[0] "), DisplayName("")]
public float Rotation { get => previewer.Rotation; set => previewer.Rotation = value; } public float Rotation { get => previewer.Rotation; set => previewer.Rotation = value; }
[Category("导出"), DisplayName("水平翻转")] [Category("[0] "), DisplayName("")]
public bool FlipX { get => previewer.FlipX; set => previewer.FlipX = value; } public bool FlipX { get => previewer.FlipX; set => previewer.FlipX = value; }
[Category("导出"), DisplayName("垂直翻转")] [Category("[0] "), DisplayName("")]
public bool FlipY { get => previewer.FlipY; set => previewer.FlipY = value; } public bool FlipY { get => previewer.FlipY; set => previewer.FlipY = value; }
[Category("导出"), DisplayName("仅渲染选中")] [Category("[0] "), DisplayName("")]
public bool RenderSelectedOnly { get => previewer.RenderSelectedOnly; set => previewer.RenderSelectedOnly = value; } public bool RenderSelectedOnly { get => previewer.RenderSelectedOnly; set => previewer.RenderSelectedOnly = value; }
[Category("预览"), DisplayName("显示坐标轴")] [Category("[1] "), DisplayName("")]
public bool ShowAxis { get => previewer.ShowAxis; set => previewer.ShowAxis = value; } public bool ShowAxis { get => previewer.ShowAxis; set => previewer.ShowAxis = value; }
[Category("预览"), DisplayName("最大帧率")] [Category("[1] "), DisplayName("")]
public uint MaxFps { get => previewer.MaxFps; set => previewer.MaxFps = value; } public uint MaxFps { get => previewer.MaxFps; set => previewer.MaxFps = value; }
} }
@@ -371,6 +371,16 @@ namespace SpineViewer.Controls
delta = Clock.ElapsedTime.AsSeconds(); delta = Clock.ElapsedTime.AsSeconds();
Clock.Restart(); Clock.Restart();
// 停止更新的时候只是时间不前进, 但是坐标变换还是要更新, 否则无法移动对象
if (!IsUpdating) delta = 0;
// 加上要快进的量
lock (_forwardDeltaLock)
{
delta += forwardDelta;
forwardDelta = 0;
}
RenderWindow.Clear(BackgroundColor); RenderWindow.Clear(BackgroundColor);
if (ShowAxis) if (ShowAxis)
@@ -389,24 +399,14 @@ namespace SpineViewer.Controls
{ {
lock (SpineListView.Spines) lock (SpineListView.Spines)
{ {
var spines = SpineListView.Spines; var spines = SpineListView.Spines.Where(sp => !sp.IsHidden).ToArray();
for (int i = spines.Count - 1; i >= 0; i--) for (int i = spines.Length - 1; i >= 0; i--)
{ {
if (cancelToken is not null && cancelToken.IsCancellationRequested) if (cancelToken is not null && cancelToken.IsCancellationRequested)
break; // 提前中止 break; // 提前中止
var spine = spines[i]; var spine = spines[i];
// 停止更新的时候只是时间不前进, 但是坐标变换还是要更新, 否则无法移动对象
if (!IsUpdating) delta = 0;
// 加上要快进的量
lock (_forwardDeltaLock)
{
delta += forwardDelta;
forwardDelta = 0;
}
spine.Update(delta); spine.Update(delta);
if (RenderSelectedOnly && !spine.IsSelected) if (RenderSelectedOnly && !spine.IsSelected)
@@ -487,9 +487,11 @@ namespace SpineViewer.Controls
// 仅渲染选中模式禁止在画面里选择对象 // 仅渲染选中模式禁止在画面里选择对象
if (RenderSelectedOnly) if (RenderSelectedOnly)
{ {
// 只在被选中的对象里判断是否有效命中
bool hit = false; bool hit = false;
foreach (int i in SpineListView.SelectedIndices) foreach (int i in SpineListView.SelectedIndices)
{ {
if (spines[i].IsHidden) continue;
if (!spines[i].Bounds.Contains(src)) continue; if (!spines[i].Bounds.Contains(src)) continue;
hit = true; hit = true;
break; break;
@@ -500,12 +502,13 @@ namespace SpineViewer.Controls
} }
else else
{ {
// 没有按下 Ctrl 键就只选中点击的那个, 所以先清空选中列表
if ((ModifierKeys & Keys.Control) == 0) if ((ModifierKeys & Keys.Control) == 0)
{ {
// 没按 Ctrl 的情况下, 如果命中了已选中对象, 则就算普通命中
bool hit = false; bool hit = false;
for (int i = 0; i < spines.Count; i++) for (int i = 0; i < spines.Count; i++)
{ {
if (spines[i].IsHidden) continue;
if (!spines[i].Bounds.Contains(src)) continue; if (!spines[i].Bounds.Contains(src)) continue;
hit = true; hit = true;
@@ -524,10 +527,11 @@ namespace SpineViewer.Controls
} }
else else
{ {
// 按下 Ctrl 的情况就执行多选, 并且点空白处也不会清空选中
for (int i = 0; i < spines.Count; i++) for (int i = 0; i < spines.Count; i++)
{ {
if (!spines[i].Bounds.Contains(src)) if (spines[i].IsHidden) continue;
continue; if (!spines[i].Bounds.Contains(src)) continue;
SpineListView.SelectedIndices.Add(i); SpineListView.SelectedIndices.Add(i);
break; break;
@@ -558,8 +562,12 @@ namespace SpineViewer.Controls
{ {
lock (SpineListView.Spines) lock (SpineListView.Spines)
{ {
var spines = SpineListView.Spines;
foreach (int i in SpineListView.SelectedIndices) foreach (int i in SpineListView.SelectedIndices)
SpineListView.Spines[i].Position += delta; {
if (spines[i].IsHidden) continue;
spines[i].Position += delta;
}
} }
} }
draggingSrc = dst; draggingSrc = dst;

View File

@@ -39,7 +39,7 @@ namespace SpineViewer.Dialogs
PropertyInfo? labelProp = category.GetType().GetProperty("Label", BindingFlags.Instance | BindingFlags.Public); PropertyInfo? labelProp = category.GetType().GetProperty("Label", BindingFlags.Instance | BindingFlags.Public);
if (labelProp == null) continue; if (labelProp == null) continue;
string? label = labelProp.GetValue(category) as string; string? label = labelProp.GetValue(category) as string;
if (label != "导出") continue; if (label != "[0] 导出") continue;
// 获取该分组下的所有属性项 // 获取该分组下的所有属性项
PropertyInfo? gridItemsProp = category.GetType().GetProperty("GridItems", BindingFlags.Instance | BindingFlags.Public); PropertyInfo? gridItemsProp = category.GetType().GetProperty("GridItems", BindingFlags.Instance | BindingFlags.Public);

View File

@@ -60,32 +60,32 @@ namespace SpineViewer.Exporter
/// 输出文件夹 /// 输出文件夹
/// </summary> /// </summary>
[Editor(typeof(FolderNameEditor), typeof(UITypeEditor))] [Editor(typeof(FolderNameEditor), typeof(UITypeEditor))]
[Category("导出"), DisplayName("输出文件夹"), Description("逐个导出时可以留空,将逐个导出到模型自身所在目录")] [Category("[0] "), DisplayName(""), Description("")]
public string? OutputDir { get; set; } = null; public string? OutputDir { get; set; } = null;
/// <summary> /// <summary>
/// 导出单个 /// 导出单个
/// </summary> /// </summary>
[Category("导出"), DisplayName("导出单个"), Description("是否将模型在同一个画面上导出单个文件,否则逐个导出模型")] [Category("[0] "), DisplayName(""), Description("")]
public bool ExportSingle { get; set; } = false; public bool ExportSingle { get; set; } = false;
/// <summary> /// <summary>
/// 画面分辨率 /// 画面分辨率
/// </summary> /// </summary>
[TypeConverter(typeof(SizeConverter))] [TypeConverter(typeof(SizeConverter))]
[Category("导出"), DisplayName("分辨率"), Description("画面的宽高像素大小,请在预览画面参数面板进行调整")] [Category("[0] "), DisplayName(""), Description("")]
public Size Resolution { get; } public Size Resolution { get; }
/// <summary> /// <summary>
/// 渲染视窗 /// 渲染视窗
/// </summary> /// </summary>
[Category("导出"), DisplayName("视图"), Description("画面的视图参数,请在预览画面参数面板进行调整")] [Category("[0] "), DisplayName(""), Description("")]
public SFML.Graphics.View View { get; } public SFML.Graphics.View View { get; }
/// <summary> /// <summary>
/// 是否仅渲染选中 /// 是否仅渲染选中
/// </summary> /// </summary>
[Category("导出"), DisplayName("仅渲染选中"), Description("是否仅导出选中的模型,请在预览画面参数面板进行调整")] [Category("[0] "), DisplayName(""), Description("")]
public bool RenderSelectedOnly { get; } public bool RenderSelectedOnly { get; }
/// <summary> /// <summary>

View File

@@ -20,7 +20,7 @@ namespace SpineViewer.Exporter.Implementations.ExportArgs
/// 单帧画面格式 /// 单帧画面格式
/// </summary> /// </summary>
[TypeConverter(typeof(ImageFormatConverter))] [TypeConverter(typeof(ImageFormatConverter))]
[Category("单帧画面"), DisplayName("图像格式")] [Category("[1] "), DisplayName("")]
public ImageFormat ImageFormat public ImageFormat ImageFormat
{ {
get => imageFormat; get => imageFormat;
@@ -35,14 +35,14 @@ namespace SpineViewer.Exporter.Implementations.ExportArgs
/// <summary> /// <summary>
/// 文件名后缀 /// 文件名后缀
/// </summary> /// </summary>
[Category("单帧画面"), DisplayName("文件名后缀"), Description("与图像格式匹配的文件名后缀")] [Category("[1] "), DisplayName(""), Description("")]
public string FileSuffix { get => imageFormat.GetSuffix(); } public string FileSuffix { get => imageFormat.GetSuffix(); }
/// <summary> /// <summary>
/// DPI /// DPI
/// </summary> /// </summary>
[TypeConverter(typeof(SizeFConverter))] [TypeConverter(typeof(SizeFConverter))]
[Category("单帧画面"), DisplayName("DPI"), Description("导出图像的每英寸像素数,用于调整图像的物理尺寸")] [Category("[1] "), DisplayName("DPI"), Description("")]
public SizeF DPI public SizeF DPI
{ {
get => dpi; get => dpi;

View File

@@ -20,7 +20,7 @@ namespace SpineViewer.Exporter.Implementations.ExportArgs
/// 文件名后缀 /// 文件名后缀
/// </summary> /// </summary>
[TypeConverter(typeof(SFMLImageFileSuffixConverter))] [TypeConverter(typeof(SFMLImageFileSuffixConverter))]
[Category("帧序列参数"), DisplayName("文件名后缀"), Description("帧文件的后缀,同时决定帧图像格式")] [Category("[2] "), DisplayName(""), Description("")]
public string FileSuffix { get; set; } = ".png"; public string FileSuffix { get; set; } = ".png";
} }
} }

View File

@@ -22,14 +22,14 @@ namespace SpineViewer.Exporter.Implementations.ExportArgs
/// <summary> /// <summary>
/// 调色板最大颜色数量 /// 调色板最大颜色数量
/// </summary> /// </summary>
[Category("GIF 参数"), DisplayName("调色板最大颜色数量"), Description("设置调色板使用的最大颜色数量, 越多则色彩保留程度越高")] [Category("[2] GIF "), DisplayName(""), Description("使, ")]
public uint MaxColors { get => maxColors; set => maxColors = Math.Clamp(value, 2, 256); } public uint MaxColors { get => maxColors; set => maxColors = Math.Clamp(value, 2, 256); }
private uint maxColors = 256; private uint maxColors = 256;
/// <summary> /// <summary>
/// 透明度阈值 /// 透明度阈值
/// </summary> /// </summary>
[Category("GIF 参数"), DisplayName("透明度阈值"), Description("小于该值的像素点会被认为是透明像素")] [Category("[2] GIF "), DisplayName(""), Description("")]
public byte AlphaThreshold { get => alphaThreshold; set => alphaThreshold = value; } public byte AlphaThreshold { get => alphaThreshold; set => alphaThreshold = value; }
private byte alphaThreshold = 128; private byte alphaThreshold = 128;

View File

@@ -17,7 +17,7 @@ namespace SpineViewer.Exporter.Implementations.ExportArgs
/// <summary> /// <summary>
/// 导出时长 /// 导出时长
/// </summary> /// </summary>
[Category("视频参数"), DisplayName("时长"), Description("可以从模型列表查看动画时长, 如果小于 0, 则在逐个导出时每个模型使用各自的当前动画时长")] [Category("[1] "), DisplayName(""), Description(", 0, 使")]
public float Duration public float Duration
{ {
get => duration; get => duration;
@@ -28,7 +28,7 @@ namespace SpineViewer.Exporter.Implementations.ExportArgs
/// <summary> /// <summary>
/// 帧率 /// 帧率
/// </summary> /// </summary>
[Category("视频参数"), DisplayName("帧率"), Description("每秒画面数")] [Category("[1] "), DisplayName(""), Description("")]
public float FPS { get; set; } = 60; public float FPS { get; set; } = 60;
public override string? Validate() public override string? Validate()

View File

@@ -114,88 +114,88 @@
// //
toolStripMenuItem_Open.Name = "toolStripMenuItem_Open"; toolStripMenuItem_Open.Name = "toolStripMenuItem_Open";
toolStripMenuItem_Open.ShortcutKeys = Keys.Control | Keys.O; toolStripMenuItem_Open.ShortcutKeys = Keys.Control | Keys.O;
toolStripMenuItem_Open.Size = new Size(270, 34); toolStripMenuItem_Open.Size = new Size(254, 34);
toolStripMenuItem_Open.Text = "打开(&O)..."; toolStripMenuItem_Open.Text = "打开(&O)...";
toolStripMenuItem_Open.Click += toolStripMenuItem_Open_Click; toolStripMenuItem_Open.Click += toolStripMenuItem_Open_Click;
// //
// toolStripMenuItem_BatchOpen // toolStripMenuItem_BatchOpen
// //
toolStripMenuItem_BatchOpen.Name = "toolStripMenuItem_BatchOpen"; toolStripMenuItem_BatchOpen.Name = "toolStripMenuItem_BatchOpen";
toolStripMenuItem_BatchOpen.Size = new Size(270, 34); toolStripMenuItem_BatchOpen.Size = new Size(254, 34);
toolStripMenuItem_BatchOpen.Text = "批量打开(&B)..."; toolStripMenuItem_BatchOpen.Text = "批量打开(&B)...";
toolStripMenuItem_BatchOpen.Click += toolStripMenuItem_BatchOpen_Click; toolStripMenuItem_BatchOpen.Click += toolStripMenuItem_BatchOpen_Click;
// //
// toolStripSeparator1 // toolStripSeparator1
// //
toolStripSeparator1.Name = "toolStripSeparator1"; toolStripSeparator1.Name = "toolStripSeparator1";
toolStripSeparator1.Size = new Size(267, 6); toolStripSeparator1.Size = new Size(251, 6);
// //
// toolStripMenuItem_Export // toolStripMenuItem_Export
// //
toolStripMenuItem_Export.DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItem_ExportFrame, toolStripMenuItem_ExportFrameSequence, toolStripMenuItem_ExportGif, toolStripMenuItem_ExportMkv, toolStripMenuItem_ExportMp4, toolStripMenuItem_ExportMov, toolStripMenuItem_ExportWebm }); toolStripMenuItem_Export.DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItem_ExportFrame, toolStripMenuItem_ExportFrameSequence, toolStripMenuItem_ExportGif, toolStripMenuItem_ExportMkv, toolStripMenuItem_ExportMp4, toolStripMenuItem_ExportMov, toolStripMenuItem_ExportWebm });
toolStripMenuItem_Export.Name = "toolStripMenuItem_Export"; toolStripMenuItem_Export.Name = "toolStripMenuItem_Export";
toolStripMenuItem_Export.Size = new Size(270, 34); toolStripMenuItem_Export.Size = new Size(254, 34);
toolStripMenuItem_Export.Text = "导出(&E)"; toolStripMenuItem_Export.Text = "导出(&E)";
// //
// toolStripMenuItem_ExportFrame // toolStripMenuItem_ExportFrame
// //
toolStripMenuItem_ExportFrame.Name = "toolStripMenuItem_ExportFrame"; toolStripMenuItem_ExportFrame.Name = "toolStripMenuItem_ExportFrame";
toolStripMenuItem_ExportFrame.Size = new Size(270, 34); toolStripMenuItem_ExportFrame.Size = new Size(194, 34);
toolStripMenuItem_ExportFrame.Text = "单帧画面..."; toolStripMenuItem_ExportFrame.Text = "单帧画面...";
toolStripMenuItem_ExportFrame.Click += toolStripMenuItem_Export_Click; toolStripMenuItem_ExportFrame.Click += toolStripMenuItem_Export_Click;
// //
// toolStripMenuItem_ExportFrameSequence // toolStripMenuItem_ExportFrameSequence
// //
toolStripMenuItem_ExportFrameSequence.Name = "toolStripMenuItem_ExportFrameSequence"; toolStripMenuItem_ExportFrameSequence.Name = "toolStripMenuItem_ExportFrameSequence";
toolStripMenuItem_ExportFrameSequence.Size = new Size(270, 34); toolStripMenuItem_ExportFrameSequence.Size = new Size(194, 34);
toolStripMenuItem_ExportFrameSequence.Text = "帧序列..."; toolStripMenuItem_ExportFrameSequence.Text = "帧序列...";
toolStripMenuItem_ExportFrameSequence.Click += toolStripMenuItem_Export_Click; toolStripMenuItem_ExportFrameSequence.Click += toolStripMenuItem_Export_Click;
// //
// toolStripMenuItem_ExportGif // toolStripMenuItem_ExportGif
// //
toolStripMenuItem_ExportGif.Name = "toolStripMenuItem_ExportGif"; toolStripMenuItem_ExportGif.Name = "toolStripMenuItem_ExportGif";
toolStripMenuItem_ExportGif.Size = new Size(270, 34); toolStripMenuItem_ExportGif.Size = new Size(194, 34);
toolStripMenuItem_ExportGif.Text = "GIF..."; toolStripMenuItem_ExportGif.Text = "GIF...";
toolStripMenuItem_ExportGif.Click += toolStripMenuItem_Export_Click; toolStripMenuItem_ExportGif.Click += toolStripMenuItem_Export_Click;
// //
// toolStripMenuItem_ExportMkv // toolStripMenuItem_ExportMkv
// //
toolStripMenuItem_ExportMkv.Name = "toolStripMenuItem_ExportMkv"; toolStripMenuItem_ExportMkv.Name = "toolStripMenuItem_ExportMkv";
toolStripMenuItem_ExportMkv.Size = new Size(270, 34); toolStripMenuItem_ExportMkv.Size = new Size(194, 34);
toolStripMenuItem_ExportMkv.Text = "MKV"; toolStripMenuItem_ExportMkv.Text = "MKV";
toolStripMenuItem_ExportMkv.Click += toolStripMenuItem_Export_Click; toolStripMenuItem_ExportMkv.Click += toolStripMenuItem_Export_Click;
// //
// toolStripMenuItem_ExportMp4 // toolStripMenuItem_ExportMp4
// //
toolStripMenuItem_ExportMp4.Name = "toolStripMenuItem_ExportMp4"; toolStripMenuItem_ExportMp4.Name = "toolStripMenuItem_ExportMp4";
toolStripMenuItem_ExportMp4.Size = new Size(270, 34); toolStripMenuItem_ExportMp4.Size = new Size(194, 34);
toolStripMenuItem_ExportMp4.Text = "MP4..."; toolStripMenuItem_ExportMp4.Text = "MP4...";
toolStripMenuItem_ExportMp4.Click += toolStripMenuItem_Export_Click; toolStripMenuItem_ExportMp4.Click += toolStripMenuItem_Export_Click;
// //
// toolStripMenuItem_ExportMov // toolStripMenuItem_ExportMov
// //
toolStripMenuItem_ExportMov.Name = "toolStripMenuItem_ExportMov"; toolStripMenuItem_ExportMov.Name = "toolStripMenuItem_ExportMov";
toolStripMenuItem_ExportMov.Size = new Size(270, 34); toolStripMenuItem_ExportMov.Size = new Size(194, 34);
toolStripMenuItem_ExportMov.Text = "MOV..."; toolStripMenuItem_ExportMov.Text = "MOV...";
toolStripMenuItem_ExportMov.Click += toolStripMenuItem_Export_Click; toolStripMenuItem_ExportMov.Click += toolStripMenuItem_Export_Click;
// //
// toolStripMenuItem_ExportWebm // toolStripMenuItem_ExportWebm
// //
toolStripMenuItem_ExportWebm.Name = "toolStripMenuItem_ExportWebm"; toolStripMenuItem_ExportWebm.Name = "toolStripMenuItem_ExportWebm";
toolStripMenuItem_ExportWebm.Size = new Size(270, 34); toolStripMenuItem_ExportWebm.Size = new Size(194, 34);
toolStripMenuItem_ExportWebm.Text = "WebM..."; toolStripMenuItem_ExportWebm.Text = "WebM...";
toolStripMenuItem_ExportWebm.Click += toolStripMenuItem_Export_Click; toolStripMenuItem_ExportWebm.Click += toolStripMenuItem_Export_Click;
// //
// toolStripSeparator2 // toolStripSeparator2
// //
toolStripSeparator2.Name = "toolStripSeparator2"; toolStripSeparator2.Name = "toolStripSeparator2";
toolStripSeparator2.Size = new Size(267, 6); toolStripSeparator2.Size = new Size(251, 6);
// //
// toolStripMenuItem_Exit // toolStripMenuItem_Exit
// //
toolStripMenuItem_Exit.Name = "toolStripMenuItem_Exit"; toolStripMenuItem_Exit.Name = "toolStripMenuItem_Exit";
toolStripMenuItem_Exit.ShortcutKeys = Keys.Alt | Keys.F4; toolStripMenuItem_Exit.ShortcutKeys = Keys.Alt | Keys.F4;
toolStripMenuItem_Exit.Size = new Size(270, 34); toolStripMenuItem_Exit.Size = new Size(254, 34);
toolStripMenuItem_Exit.Text = "退出(&X)"; toolStripMenuItem_Exit.Text = "退出(&X)";
toolStripMenuItem_Exit.Click += toolStripMenuItem_Exit_Click; toolStripMenuItem_Exit.Click += toolStripMenuItem_Exit_Click;
// //
@@ -263,7 +263,7 @@
rtbLog.Margin = new Padding(3, 2, 3, 2); rtbLog.Margin = new Padding(3, 2, 3, 2);
rtbLog.Name = "rtbLog"; rtbLog.Name = "rtbLog";
rtbLog.ReadOnly = true; rtbLog.ReadOnly = true;
rtbLog.Size = new Size(1728, 114); rtbLog.Size = new Size(1728, 110);
rtbLog.TabIndex = 0; rtbLog.TabIndex = 0;
rtbLog.Text = ""; rtbLog.Text = "";
rtbLog.WordWrap = false; rtbLog.WordWrap = false;
@@ -287,6 +287,7 @@
splitContainer_MainForm.Panel2.Cursor = Cursors.Default; splitContainer_MainForm.Panel2.Cursor = Cursors.Default;
splitContainer_MainForm.Size = new Size(1728, 997); splitContainer_MainForm.Size = new Size(1728, 997);
splitContainer_MainForm.SplitterDistance = 879; splitContainer_MainForm.SplitterDistance = 879;
splitContainer_MainForm.SplitterWidth = 8;
splitContainer_MainForm.TabIndex = 3; splitContainer_MainForm.TabIndex = 3;
splitContainer_MainForm.TabStop = false; splitContainer_MainForm.TabStop = false;
splitContainer_MainForm.SplitterMoved += splitContainer_SplitterMoved; splitContainer_MainForm.SplitterMoved += splitContainer_SplitterMoved;
@@ -310,6 +311,7 @@
splitContainer_Functional.Panel2.Cursor = Cursors.Default; splitContainer_Functional.Panel2.Cursor = Cursors.Default;
splitContainer_Functional.Size = new Size(1728, 879); splitContainer_Functional.Size = new Size(1728, 879);
splitContainer_Functional.SplitterDistance = 747; splitContainer_Functional.SplitterDistance = 747;
splitContainer_Functional.SplitterWidth = 8;
splitContainer_Functional.TabIndex = 2; splitContainer_Functional.TabIndex = 2;
splitContainer_Functional.TabStop = false; splitContainer_Functional.TabStop = false;
splitContainer_Functional.SplitterMoved += splitContainer_SplitterMoved; splitContainer_Functional.SplitterMoved += splitContainer_SplitterMoved;
@@ -333,6 +335,7 @@
splitContainer_Information.Panel2.Cursor = Cursors.Default; splitContainer_Information.Panel2.Cursor = Cursors.Default;
splitContainer_Information.Size = new Size(747, 879); splitContainer_Information.Size = new Size(747, 879);
splitContainer_Information.SplitterDistance = 399; splitContainer_Information.SplitterDistance = 399;
splitContainer_Information.SplitterWidth = 8;
splitContainer_Information.TabIndex = 1; splitContainer_Information.TabIndex = 1;
splitContainer_Information.TabStop = false; splitContainer_Information.TabStop = false;
splitContainer_Information.SplitterMoved += splitContainer_SplitterMoved; splitContainer_Information.SplitterMoved += splitContainer_SplitterMoved;
@@ -364,7 +367,7 @@
propertyGrid_Spine.HelpVisible = false; propertyGrid_Spine.HelpVisible = false;
propertyGrid_Spine.Location = new Point(3, 26); propertyGrid_Spine.Location = new Point(3, 26);
propertyGrid_Spine.Name = "propertyGrid_Spine"; propertyGrid_Spine.Name = "propertyGrid_Spine";
propertyGrid_Spine.Size = new Size(338, 485); propertyGrid_Spine.Size = new Size(334, 509);
propertyGrid_Spine.TabIndex = 0; propertyGrid_Spine.TabIndex = 0;
propertyGrid_Spine.ToolbarVisible = false; propertyGrid_Spine.ToolbarVisible = false;
propertyGrid_Spine.PropertyValueChanged += propertyGrid_PropertyValueChanged; propertyGrid_Spine.PropertyValueChanged += propertyGrid_PropertyValueChanged;
@@ -379,15 +382,16 @@
// //
// splitContainer_Config.Panel1 // splitContainer_Config.Panel1
// //
splitContainer_Config.Panel1.Controls.Add(groupBox_SkelConfig); splitContainer_Config.Panel1.Controls.Add(groupBox_PreviewConfig);
splitContainer_Config.Panel1.Cursor = Cursors.Default; splitContainer_Config.Panel1.Cursor = Cursors.Default;
// //
// splitContainer_Config.Panel2 // splitContainer_Config.Panel2
// //
splitContainer_Config.Panel2.Controls.Add(groupBox_PreviewConfig); splitContainer_Config.Panel2.Controls.Add(groupBox_SkelConfig);
splitContainer_Config.Panel2.Cursor = Cursors.Default; splitContainer_Config.Panel2.Cursor = Cursors.Default;
splitContainer_Config.Size = new Size(344, 879); splitContainer_Config.Size = new Size(340, 879);
splitContainer_Config.SplitterDistance = 514; splitContainer_Config.SplitterDistance = 333;
splitContainer_Config.SplitterWidth = 8;
splitContainer_Config.TabIndex = 0; splitContainer_Config.TabIndex = 0;
splitContainer_Config.TabStop = false; splitContainer_Config.TabStop = false;
splitContainer_Config.SplitterMoved += splitContainer_SplitterMoved; splitContainer_Config.SplitterMoved += splitContainer_SplitterMoved;
@@ -399,7 +403,7 @@
groupBox_SkelConfig.Dock = DockStyle.Fill; groupBox_SkelConfig.Dock = DockStyle.Fill;
groupBox_SkelConfig.Location = new Point(0, 0); groupBox_SkelConfig.Location = new Point(0, 0);
groupBox_SkelConfig.Name = "groupBox_SkelConfig"; groupBox_SkelConfig.Name = "groupBox_SkelConfig";
groupBox_SkelConfig.Size = new Size(344, 514); groupBox_SkelConfig.Size = new Size(340, 538);
groupBox_SkelConfig.TabIndex = 0; groupBox_SkelConfig.TabIndex = 0;
groupBox_SkelConfig.TabStop = false; groupBox_SkelConfig.TabStop = false;
groupBox_SkelConfig.Text = "模型参数"; groupBox_SkelConfig.Text = "模型参数";
@@ -410,7 +414,7 @@
groupBox_PreviewConfig.Dock = DockStyle.Fill; groupBox_PreviewConfig.Dock = DockStyle.Fill;
groupBox_PreviewConfig.Location = new Point(0, 0); groupBox_PreviewConfig.Location = new Point(0, 0);
groupBox_PreviewConfig.Name = "groupBox_PreviewConfig"; groupBox_PreviewConfig.Name = "groupBox_PreviewConfig";
groupBox_PreviewConfig.Size = new Size(344, 361); groupBox_PreviewConfig.Size = new Size(340, 333);
groupBox_PreviewConfig.TabIndex = 1; groupBox_PreviewConfig.TabIndex = 1;
groupBox_PreviewConfig.TabStop = false; groupBox_PreviewConfig.TabStop = false;
groupBox_PreviewConfig.Text = "画面参数"; groupBox_PreviewConfig.Text = "画面参数";
@@ -421,7 +425,7 @@
propertyGrid_Previewer.HelpVisible = false; propertyGrid_Previewer.HelpVisible = false;
propertyGrid_Previewer.Location = new Point(3, 26); propertyGrid_Previewer.Location = new Point(3, 26);
propertyGrid_Previewer.Name = "propertyGrid_Previewer"; propertyGrid_Previewer.Name = "propertyGrid_Previewer";
propertyGrid_Previewer.Size = new Size(338, 332); propertyGrid_Previewer.Size = new Size(334, 304);
propertyGrid_Previewer.TabIndex = 1; propertyGrid_Previewer.TabIndex = 1;
propertyGrid_Previewer.ToolbarVisible = false; propertyGrid_Previewer.ToolbarVisible = false;
propertyGrid_Previewer.PropertyValueChanged += propertyGrid_PropertyValueChanged; propertyGrid_Previewer.PropertyValueChanged += propertyGrid_PropertyValueChanged;
@@ -432,7 +436,7 @@
groupBox_Preview.Dock = DockStyle.Fill; groupBox_Preview.Dock = DockStyle.Fill;
groupBox_Preview.Location = new Point(0, 0); groupBox_Preview.Location = new Point(0, 0);
groupBox_Preview.Name = "groupBox_Preview"; groupBox_Preview.Name = "groupBox_Preview";
groupBox_Preview.Size = new Size(977, 879); groupBox_Preview.Size = new Size(973, 879);
groupBox_Preview.TabIndex = 1; groupBox_Preview.TabIndex = 1;
groupBox_Preview.TabStop = false; groupBox_Preview.TabStop = false;
groupBox_Preview.Text = "预览画面"; groupBox_Preview.Text = "预览画面";
@@ -443,7 +447,7 @@
spinePreviewer.Location = new Point(3, 26); spinePreviewer.Location = new Point(3, 26);
spinePreviewer.Name = "spinePreviewer"; spinePreviewer.Name = "spinePreviewer";
spinePreviewer.PropertyGrid = propertyGrid_Previewer; spinePreviewer.PropertyGrid = propertyGrid_Previewer;
spinePreviewer.Size = new Size(971, 850); spinePreviewer.Size = new Size(967, 850);
spinePreviewer.SpineListView = spineListView; spinePreviewer.SpineListView = spineListView;
spinePreviewer.TabIndex = 0; spinePreviewer.TabIndex = 0;
// //

View File

@@ -87,15 +87,6 @@ namespace SpineViewer
return; return;
} }
lock (spineListView.Spines)
{
if (spineListView.Spines.Count <= 0)
{
MessageBox.Info("请至少打开一个骨骼文件");
return;
}
}
var exportArgs = ExportArgs.New(type, spinePreviewer.Resolution, spinePreviewer.GetView(), spinePreviewer.RenderSelectedOnly); var exportArgs = ExportArgs.New(type, spinePreviewer.Resolution, spinePreviewer.GetView(), spinePreviewer.RenderSelectedOnly);
var exportDialog = new Dialogs.ExportDialog() { ExportArgs = exportArgs }; var exportDialog = new Dialogs.ExportDialog() { ExportArgs = exportArgs };
if (exportDialog.ShowDialog() != DialogResult.OK) if (exportDialog.ShowDialog() != DialogResult.OK)
@@ -156,7 +147,7 @@ namespace SpineViewer
var worker = (BackgroundWorker)sender; var worker = (BackgroundWorker)sender;
var exporter = (Exporter.Exporter)e.Argument; var exporter = (Exporter.Exporter)e.Argument;
spinePreviewer.StopRender(); spinePreviewer.StopRender();
lock (spineListView.Spines) { exporter.Export(spineListView.Spines.ToArray(), (BackgroundWorker)sender); } lock (spineListView.Spines) { exporter.Export(spineListView.Spines.Where(sp => !sp.IsHidden).ToArray(), (BackgroundWorker)sender); }
e.Cancel = worker.CancellationPending; e.Cancel = worker.CancellationPending;
spinePreviewer.StartRender(); spinePreviewer.StartRender();
} }

View File

@@ -337,7 +337,11 @@ namespace SpineViewer.Spine.Implementations.Spine
states.Shader = FragmentShader; states.Shader = FragmentShader;
else else
states.Shader = null; states.Shader = null;
target.Draw(vertexArray, states);
// 调试纹理
if (!IsDebug || DebugTexture)
target.Draw(vertexArray, states);
vertexArray.Clear(); vertexArray.Clear();
} }
states.BlendMode = blendMode; states.BlendMode = blendMode;
@@ -382,9 +386,12 @@ namespace SpineViewer.Spine.Implementations.Spine
states.Shader = FragmentShader; states.Shader = FragmentShader;
else else
states.Shader = null; states.Shader = null;
target.Draw(vertexArray, states);
//clipping.ClipEnd(); //clipping.ClipEnd();
// 调试纹理
if (!IsDebug || DebugTexture)
target.Draw(vertexArray, states);
// 包围盒 // 包围盒
if (IsDebug && IsSelected && DebugBounds) if (IsDebug && IsSelected && DebugBounds)
{ {

View File

@@ -294,7 +294,11 @@ namespace SpineViewer.Spine.Implementations.Spine
states.Shader = FragmentShader; states.Shader = FragmentShader;
else else
states.Shader = null; states.Shader = null;
target.Draw(vertexArray, states);
// 调试纹理
if (!IsDebug || DebugTexture)
target.Draw(vertexArray, states);
vertexArray.Clear(); vertexArray.Clear();
} }
states.BlendMode = blendMode; states.BlendMode = blendMode;
@@ -334,13 +338,16 @@ namespace SpineViewer.Spine.Implementations.Spine
clipping.ClipEnd(slot); clipping.ClipEnd(slot);
} }
clipping.ClipEnd();
if (UsePremultipliedAlpha && (states.BlendMode == BlendModeSFML.Normal || states.BlendMode == BlendModeSFML.Additive)) if (UsePremultipliedAlpha && (states.BlendMode == BlendModeSFML.Normal || states.BlendMode == BlendModeSFML.Additive))
states.Shader = FragmentShader; states.Shader = FragmentShader;
else else
states.Shader = null; states.Shader = null;
target.Draw(vertexArray, states);
clipping.ClipEnd(); // 调试纹理
if (!IsDebug || DebugTexture)
target.Draw(vertexArray, states);
// 包围盒 // 包围盒
if (IsDebug && IsSelected && DebugBounds) if (IsDebug && IsSelected && DebugBounds)

View File

@@ -312,7 +312,11 @@ namespace SpineViewer.Spine.Implementations.Spine
states.Shader = FragmentShader; states.Shader = FragmentShader;
else else
states.Shader = null; states.Shader = null;
target.Draw(vertexArray, states);
// 调试纹理
if (!IsDebug || DebugTexture)
target.Draw(vertexArray, states);
vertexArray.Clear(); vertexArray.Clear();
} }
states.BlendMode = blendMode; states.BlendMode = blendMode;
@@ -352,13 +356,16 @@ namespace SpineViewer.Spine.Implementations.Spine
clipping.ClipEnd(slot); clipping.ClipEnd(slot);
} }
clipping.ClipEnd();
if (UsePremultipliedAlpha && (states.BlendMode == BlendModeSFML.Normal || states.BlendMode == BlendModeSFML.Additive)) if (UsePremultipliedAlpha && (states.BlendMode == BlendModeSFML.Normal || states.BlendMode == BlendModeSFML.Additive))
states.Shader = FragmentShader; states.Shader = FragmentShader;
else else
states.Shader = null; states.Shader = null;
target.Draw(vertexArray, states);
clipping.ClipEnd(); // 调试纹理
if (!IsDebug || DebugTexture)
target.Draw(vertexArray, states);
// 包围盒 // 包围盒
if (IsDebug && IsSelected && DebugBounds) if (IsDebug && IsSelected && DebugBounds)

View File

@@ -271,7 +271,11 @@ namespace SpineViewer.Spine.Implementations.Spine
states.Shader = FragmentShader; states.Shader = FragmentShader;
else else
states.Shader = null; states.Shader = null;
target.Draw(vertexArray, states);
// 调试纹理
if (!IsDebug || DebugTexture)
target.Draw(vertexArray, states);
vertexArray.Clear(); vertexArray.Clear();
} }
states.BlendMode = blendMode; states.BlendMode = blendMode;
@@ -311,15 +315,18 @@ namespace SpineViewer.Spine.Implementations.Spine
clipping.ClipEnd(slot); clipping.ClipEnd(slot);
} }
clipping.ClipEnd();
if (UsePremultipliedAlpha && (states.BlendMode == BlendModeSFML.Normal || states.BlendMode == BlendModeSFML.Additive)) if (UsePremultipliedAlpha && (states.BlendMode == BlendModeSFML.Normal || states.BlendMode == BlendModeSFML.Additive))
states.Shader = FragmentShader; states.Shader = FragmentShader;
else else
states.Shader = null; states.Shader = null;
target.Draw(vertexArray, states);
clipping.ClipEnd();
// 包围盒 // 调试纹理
if (!IsDebug || DebugTexture)
target.Draw(vertexArray, states);
// 调试包围盒
if (IsDebug && IsSelected && DebugBounds) if (IsDebug && IsSelected && DebugBounds)
{ {
var bounds = Bounds; var bounds = Bounds;

View File

@@ -267,7 +267,11 @@ namespace SpineViewer.Spine.Implementations.Spine
states.Shader = FragmentShader; states.Shader = FragmentShader;
else else
states.Shader = null; states.Shader = null;
target.Draw(vertexArray, states);
// 调试纹理
if (!IsDebug || DebugTexture)
target.Draw(vertexArray, states);
vertexArray.Clear(); vertexArray.Clear();
} }
states.BlendMode = blendMode; states.BlendMode = blendMode;
@@ -307,13 +311,16 @@ namespace SpineViewer.Spine.Implementations.Spine
clipping.ClipEnd(slot); clipping.ClipEnd(slot);
} }
clipping.ClipEnd();
if (UsePremultipliedAlpha && (states.BlendMode == BlendModeSFML.Normal || states.BlendMode == BlendModeSFML.Additive)) if (UsePremultipliedAlpha && (states.BlendMode == BlendModeSFML.Normal || states.BlendMode == BlendModeSFML.Additive))
states.Shader = FragmentShader; states.Shader = FragmentShader;
else else
states.Shader = null; states.Shader = null;
target.Draw(vertexArray, states);
clipping.ClipEnd(); // 调试纹理
if (!IsDebug || DebugTexture)
target.Draw(vertexArray, states);
// 包围盒 // 包围盒
if (IsDebug && IsSelected && DebugBounds) if (IsDebug && IsSelected && DebugBounds)

View File

@@ -267,7 +267,11 @@ namespace SpineViewer.Spine.Implementations.Spine
states.Shader = FragmentShader; states.Shader = FragmentShader;
else else
states.Shader = null; states.Shader = null;
target.Draw(vertexArray, states);
// 调试纹理
if (!IsDebug || DebugTexture)
target.Draw(vertexArray, states);
vertexArray.Clear(); vertexArray.Clear();
} }
states.BlendMode = blendMode; states.BlendMode = blendMode;
@@ -307,13 +311,16 @@ namespace SpineViewer.Spine.Implementations.Spine
clipping.ClipEnd(slot); clipping.ClipEnd(slot);
} }
clipping.ClipEnd();
if (UsePremultipliedAlpha && (states.BlendMode == BlendModeSFML.Normal || states.BlendMode == BlendModeSFML.Additive)) if (UsePremultipliedAlpha && (states.BlendMode == BlendModeSFML.Normal || states.BlendMode == BlendModeSFML.Additive))
states.Shader = FragmentShader; states.Shader = FragmentShader;
else else
states.Shader = null; states.Shader = null;
target.Draw(vertexArray, states);
clipping.ClipEnd(); // 调试纹理
if (!IsDebug || DebugTexture)
target.Draw(vertexArray, states);
// 包围盒 // 包围盒
if (IsDebug && IsSelected && DebugBounds) if (IsDebug && IsSelected && DebugBounds)

View File

@@ -267,7 +267,11 @@ namespace SpineViewer.Spine.Implementations.Spine
states.Shader = FragmentShader; states.Shader = FragmentShader;
else else
states.Shader = null; states.Shader = null;
target.Draw(vertexArray, states);
// 调试纹理
if (!IsDebug || DebugTexture)
target.Draw(vertexArray, states);
vertexArray.Clear(); vertexArray.Clear();
} }
states.BlendMode = blendMode; states.BlendMode = blendMode;
@@ -307,13 +311,16 @@ namespace SpineViewer.Spine.Implementations.Spine
clipping.ClipEnd(slot); clipping.ClipEnd(slot);
} }
clipping.ClipEnd();
if (UsePremultipliedAlpha && (states.BlendMode == BlendModeSFML.Normal || states.BlendMode == BlendModeSFML.Additive)) if (UsePremultipliedAlpha && (states.BlendMode == BlendModeSFML.Normal || states.BlendMode == BlendModeSFML.Additive))
states.Shader = FragmentShader; states.Shader = FragmentShader;
else else
states.Shader = null; states.Shader = null;
target.Draw(vertexArray, states);
clipping.ClipEnd(); // 调试纹理
if (!IsDebug || DebugTexture)
target.Draw(vertexArray, states);
// 包围盒 // 包围盒
if (IsDebug && IsSelected && DebugBounds) if (IsDebug && IsSelected && DebugBounds)

View File

@@ -185,11 +185,6 @@ namespace SpineViewer.Spine
return (Spine)Activator.CreateInstance(spineType, skelPath, atlasPath); return (Spine)Activator.CreateInstance(spineType, skelPath, atlasPath);
} }
/// <summary>
/// 标识符
/// </summary>
public readonly string ID = Guid.NewGuid().ToString();
/// <summary> /// <summary>
/// 构造函数 /// 构造函数
/// </summary> /// </summary>
@@ -217,87 +212,93 @@ namespace SpineViewer.Spine
public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }
protected virtual void Dispose(bool disposing) { preview?.Dispose(); } protected virtual void Dispose(bool disposing) { preview?.Dispose(); }
#region | #region | [0]
/// <summary> /// <summary>
/// 获取所属版本 /// 获取所属版本
/// </summary> /// </summary>
[TypeConverter(typeof(VersionConverter))] [TypeConverter(typeof(VersionConverter))]
[Category("基本信息"), DisplayName("运行时版本")] [Category("[0] "), DisplayName("")]
public Version Version { get; } public Version Version { get; }
/// <summary> /// <summary>
/// 资源所在完整目录 /// 资源所在完整目录
/// </summary> /// </summary>
[Category("基本信息"), DisplayName("资源目录")] [Category("[0] "), DisplayName("")]
public string AssetsDir { get; } public string AssetsDir { get; }
/// <summary> /// <summary>
/// skel 文件完整路径 /// skel 文件完整路径
/// </summary> /// </summary>
[Category("基本信息"), DisplayName("skel文件路径")] [Category("[0] "), DisplayName("skel文件路径")]
public string SkelPath { get; } public string SkelPath { get; }
/// <summary> /// <summary>
/// atlas 文件完整路径 /// atlas 文件完整路径
/// </summary> /// </summary>
[Category("基本信息"), DisplayName("atlas文件路径")] [Category("[0] "), DisplayName("atlas文件路径")]
public string AtlasPath { get; } public string AtlasPath { get; }
/// <summary> /// <summary>
/// 名称 /// 名称
/// </summary> /// </summary>
[Category("基本信息"), DisplayName("名称")] [Category("[0] "), DisplayName("")]
public string Name { get; } public string Name { get; }
/// <summary> /// <summary>
/// 获取所属文件版本 /// 获取所属文件版本
/// </summary> /// </summary>
[Category("基本信息"), DisplayName("文件版本")] [Category("[0] "), DisplayName("")]
public abstract string FileVersion { get; } public abstract string FileVersion { get; }
#endregion #endregion
#region | #region | [1]
/// <summary>
/// 是否被隐藏, 被隐藏的模型将仅仅在列表显示, 不参与其他行为
/// </summary>
[Category("[1] "), DisplayName("")]
public bool IsHidden { get; set; } = false;
/// <summary>
/// 是否使用预乘Alpha
/// </summary>
[Category("[1] "), DisplayName("Alpha通道")]
public bool UsePremultipliedAlpha { get; set; } = true;
#endregion
#region | [2]
/// <summary> /// <summary>
/// 缩放比例 /// 缩放比例
/// </summary> /// </summary>
[Category("变换"), DisplayName("缩放比例")] [Category("[2] "), DisplayName("")]
public abstract float Scale { get; set; } public abstract float Scale { get; set; }
/// <summary> /// <summary>
/// 位置 /// 位置
/// </summary> /// </summary>
[TypeConverter(typeof(PointFConverter))] [TypeConverter(typeof(PointFConverter))]
[Category("变换"), DisplayName("位置")] [Category("[2] "), DisplayName("")]
public abstract PointF Position { get; set; } public abstract PointF Position { get; set; }
/// <summary> /// <summary>
/// 水平翻转 /// 水平翻转
/// </summary> /// </summary>
[Category("变换"), DisplayName("水平翻转")] [Category("[2] "), DisplayName("")]
public abstract bool FlipX { get; set; } public abstract bool FlipX { get; set; }
/// <summary> /// <summary>
/// 垂直翻转 /// 垂直翻转
/// </summary> /// </summary>
[Category("变换"), DisplayName("垂直翻转")] [Category("[2] "), DisplayName("")]
public abstract bool FlipY { get; set; } public abstract bool FlipY { get; set; }
#endregion #endregion
#region | #region | [3]
/// <summary>
/// 是否使用预乘Alpha
/// </summary>
[Category("渲染"), DisplayName("预乘Alpha通道")]
public bool UsePremultipliedAlpha { get; set; } = true;
#endregion
#region |
/// <summary> /// <summary>
/// 包含的所有动画名称 /// 包含的所有动画名称
@@ -310,13 +311,13 @@ namespace SpineViewer.Spine
/// 当前动画名称, 如果设置的动画不存在则忽略 /// 当前动画名称, 如果设置的动画不存在则忽略
/// </summary> /// </summary>
[TypeConverter(typeof(AnimationConverter))] [TypeConverter(typeof(AnimationConverter))]
[Category("动画"), DisplayName("当前动画")] [Category("[3] "), DisplayName("")]
public abstract string CurrentAnimation { get; set; } public abstract string CurrentAnimation { get; set; }
/// <summary> /// <summary>
/// 当前动画时长 /// 当前动画时长
/// </summary> /// </summary>
[Category("动画"), DisplayName("当前动画时长")] [Category("[3] "), DisplayName("")]
public float CurrentAnimationDuration { get => GetAnimationDuration(CurrentAnimation); } public float CurrentAnimationDuration { get => GetAnimationDuration(CurrentAnimation); }
/// <summary> /// <summary>
@@ -330,11 +331,60 @@ namespace SpineViewer.Spine
/// 当前皮肤名称, 如果设置的皮肤不存在则忽略 /// 当前皮肤名称, 如果设置的皮肤不存在则忽略
/// </summary> /// </summary>
[TypeConverter(typeof(SkinConverter))] [TypeConverter(typeof(SkinConverter))]
[Category("动画"), DisplayName("当前皮肤")] [Category("[3] "), DisplayName("")]
public abstract string CurrentSkin { get; set; } public abstract string CurrentSkin { get; set; }
#endregion #endregion
#region | [4]
/// <summary>
/// 显示调试
/// </summary>
[Browsable(false)]
public bool IsDebug { get; set; } = false;
/// <summary>
/// 包围盒颜色
/// </summary>
protected static readonly SFML.Graphics.Color BoundsColor = new(120, 200, 0);
/// <summary>
/// 包围盒顶点数组
/// </summary>
protected readonly SFML.Graphics.VertexArray boundsVertices = new(SFML.Graphics.PrimitiveType.LineStrip, 5);
/// <summary>
/// 显示纹理
/// </summary>
[Category("[4] "), DisplayName("")]
public bool DebugTexture { get; set; } = true;
/// <summary>
/// 显示包围盒
/// </summary>
[Category("[4] "), DisplayName("")]
public bool DebugBounds { get; set; } = true;
/// <summary>
/// 显示骨骼
/// </summary>
[Category("[4] "), DisplayName("")]
public bool DebugBones { get; set; } = false;
#endregion
/// <summary>
/// 标识符
/// </summary>
public readonly string ID = Guid.NewGuid().ToString();
/// <summary>
/// 是否被选中
/// </summary>
[Browsable(false)]
public bool IsSelected { get; set; } = false;
/// <summary> /// <summary>
/// 骨骼包围盒 /// 骨骼包围盒
/// </summary> /// </summary>
@@ -403,43 +453,8 @@ namespace SpineViewer.Spine
/// <summary> /// <summary>
/// 更新内部状态 /// 更新内部状态
/// </summary> /// </summary>
/// <param name="delta">时间间隔</param>
public abstract void Update(float delta); public abstract void Update(float delta);
/// <summary>
/// 是否被选中
/// </summary>
[Browsable(false)]
public bool IsSelected { get; set; } = false;
/// <summary>
/// 显示调试
/// </summary>
[Browsable(false)]
public bool IsDebug { get; set; } = false;
/// <summary>
/// 包围盒颜色
/// </summary>
protected static readonly SFML.Graphics.Color BoundsColor = new(120, 200, 0);
/// <summary>
/// 包围盒顶点数组
/// </summary>
protected readonly SFML.Graphics.VertexArray boundsVertices = new(SFML.Graphics.PrimitiveType.LineStrip, 5);
/// <summary>
/// 显示包围盒
/// </summary>
[Category("调试"), DisplayName("显示包围盒")]
public bool DebugBounds { get; set; } = true;
/// <summary>
/// 显示骨骼
/// </summary>
[Category("调试"), DisplayName("显示骨骼(TODO)")]
public bool DebugBones { get; set; } = false;
#region SFML.Graphics.Drawable #region SFML.Graphics.Drawable
/// <summary> /// <summary>

View File

@@ -8,7 +8,7 @@
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<BaseOutputPath>$(SolutionDir)out</BaseOutputPath> <BaseOutputPath>$(SolutionDir)out</BaseOutputPath>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion> <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<Version>0.11.2</Version> <Version>0.11.3</Version>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>appicon.ico</ApplicationIcon> <ApplicationIcon>appicon.ico</ApplicationIcon>