Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/SpineViewerWPF/bin
/SpineViewerWPF/obj
/packages
/.vs
/MigrationBackup
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# SpineViewerWPF
a tool can view spine files with different spine-runtimes version and export gif or png file.
A tool that can view spine files with different spine-runtime versions and export to gif or png.

中文說明請看[這裡](README_zhTW.md)

## Usage
Start by loading an Atlas file for the specific spine you want to view, and the program will then try to import the skeleton data in JSON format and the sprite-atlas in PNG format. All 3 files must be named according to the atlas data (eg: Spine1.atlas, Spine1.json, Spine1.png). Make sure to select the correct spine version according to your skeleton data, or else there may be visual bugs, or the spine will not load/animate correctly.

## Hot Key
* Ctrl+Mousewheel Canvas Scaling
* Alt+Mousewheel Spine Scaling
* Ctrl+Mousedown+Mousemove Canvas Moving
* Alt+Mousedown+Mousemove Spine Moving

## Features
* Suppot Spine Runtimes Version
* Support Spine Runtime Versions
* **2.1.08**
* **2.1.25**
* **3.1.07**
Expand All @@ -25,23 +28,29 @@ a tool can view spine files with different spine-runtimes version and export gif
* **4.0.31**
* **4.0.64**
* **4.1.00**
* **4.2.33**
* Export animation to gif or png file.
* Can view Animation with different options.




## Usage

## Uses
Library:
- [ImageSharp](https://github.com/SixLabors/ImageSharp)
- [WpfXnaControl](https://github.com/erickeek/WpfXnaControl)
- [spine-runtimes](https://github.com/EsotericSoftware/spine-runtimes)


Requirements:
- [.NET Framework 4.7.2](http://go.microsoft.com/fwlink/?linkid=863265)
- [.NET 8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
- [Microsoft XNA Framework Redistributable 4.0](https://www.microsoft.com/en-us/download/details.aspx?id=20914)

## Changelog
* 31/01/2025 (Eleiyas)
* Upgraded program to .NET 8.0
* Updated packages to latest versions
* Imported MonoGame packages to retain usage of Microsoft.Xna.Framework
* Custom import of WpfXnaControl.dll file as original NuGet package is massively outdated
* Cleaned code
* Updated ReadMe
* Implemented Spine Runtime 4.2.33

## Issue:
* \_(:3」∠)\_
4 changes: 2 additions & 2 deletions SpineViewerWPF.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2006
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpineViewerWPF", "SpineViewerWPF\SpineViewerWPF.csproj", "{28600FC6-6C22-4BEF-8865-AD159B5E8C5F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpineViewerWPF", "SpineViewerWPF\SpineViewerWPF.csproj", "{28600FC6-6C22-4BEF-8865-AD159B5E8C5F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
1 change: 1 addition & 0 deletions SpineViewerWPF/.vs/SpineViewerWPF.csproj.dtbcache.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion SpineViewerWPF/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-6.0.1.0" newVersion="6.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down
15 changes: 5 additions & 10 deletions SpineViewerWPF/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System;
using System.Windows;
using Microsoft.Xna.Framework.Graphics;
using WpfXnaControl;

namespace SpineViewerWPF
Expand All @@ -30,9 +25,9 @@ public partial class App : Application
public static int recordImageCount;
public static double canvasWidth = SystemParameters.WorkArea.Width;
public static double canvasHeight = SystemParameters.WorkArea.Height;
public static double mainWidth ;
public static double mainHeight ;
public static double mainWidth;
public static double mainHeight;

public static string tempDirPath = $"{App.rootDir}\\Temp\\";
public static string tempDirPath = $"{App.rootDir}\\Temp\\";
}
}
20 changes: 10 additions & 10 deletions SpineViewerWPF/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<DockPanel Name="MasterGrid">
<Menu Name="mu_Header" DockPanel.Dock="Top" VerticalAlignment="Top" Height="20" >
<MenuItem Name="mi_File" Header="File" >
<MenuItem Name="mi_File_Load" Header="Open Spine" Click="loadFileToolStripMenuItem_Click" >
<MenuItem Name="mi_File_Load" Header="Open Spine" Click="LoadFileToolStripMenuItem_Click" >
</MenuItem>
<Separator />
<MenuItem Name="mi_Exit" Header="Exit" Click="mi_Exit_Click" >
<MenuItem Name="mi_Exit" Header="Exit" Click="Mi_Exit_Click" >
</MenuItem>
</MenuItem>
</Menu>
Expand All @@ -40,9 +40,9 @@
<Label Grid.Row="0" Grid.Column="1" HorizontalAlignment="Right" Content="Playing Process:" VerticalAlignment="Top" FontSize="8" Margin="0,0,0,0" />
<Label Name="lb_Loading" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Right" Content="100%" VerticalAlignment="Top" FontSize="8" Margin="0,0,0,0" />
<Slider Name="sl_Loading" Grid.Row="0" Grid.Column="3" HorizontalAlignment="Right" Width="300" Margin="0,0,0,0" Maximum="1" SmallChange="0.01" LargeChange="0.1" />
<Button Name="btn_PlayControl" Grid.Row="0" Grid.Column="4" HorizontalAlignment="Right" Content="{StaticResource img_pause}" Width="32" Margin="0,0,0,0" Height="20" Click="btn_PlayControl_Click" />
<Button Name="btn_CaptureControl" Grid.Row="0" Grid.Column="5" HorizontalAlignment="Right" Content="{StaticResource img_capture}" Width="32" Margin="0,0,0,0" Height="20" Click="btn_CaptureControl_Click" VerticalAlignment="Top" />
<Button Name="btn_RecodeControl" Grid.Row="0" Grid.Column="6" HorizontalAlignment="Right" Content="{StaticResource img_video}" Width="32" Margin="0,0,0,0" Height="20" Click="btn_RecodeControl_Click" ></Button>
<Button Name="btn_PlayControl" Grid.Row="0" Grid.Column="4" HorizontalAlignment="Right" Content="{StaticResource img_pause}" Width="32" Margin="0,0,0,0" Height="20" Click="Btn_PlayControl_Click" />
<Button Name="btn_CaptureControl" Grid.Row="0" Grid.Column="5" HorizontalAlignment="Right" Content="{StaticResource img_capture}" Width="32" Margin="0,0,0,0" Height="20" Click="Btn_CaptureControl_Click" VerticalAlignment="Top" />
<Button Name="btn_RecodeControl" Grid.Row="0" Grid.Column="6" HorizontalAlignment="Right" Content="{StaticResource img_video}" Width="32" Margin="0,0,0,0" Height="20" Click="Btn_RecodeControl_Click" ></Button>

<Border Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="7" BorderBrush="#61738B" BorderThickness="1 1 0 1" />
</Grid>
Expand Down Expand Up @@ -128,13 +128,13 @@
<Label Content="SpineUseAlpha" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" ></Label>
<CheckBox Name="chb_Alpha" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" IsChecked="True" />
<Label Content="PreMultiplyAlpha" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right" ></Label>
<CheckBox Name="chb_PreMultiplyAlpha" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" IsChecked="True" Click="chb_PreMultiplyAlpha_Click" />
<CheckBox Name="chb_PreMultiplyAlpha" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" IsChecked="True" Click="Chb_PreMultiplyAlpha_Click" />
<Label Content="IsLoop" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right" ></Label>
<CheckBox Name="chb_IsLoop" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" IsChecked="True" Click="chb_IsLoop_Click"/>
<CheckBox Name="chb_IsLoop" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" IsChecked="True" Click="Chb_IsLoop_Click"/>
<Label Content="Skin" Grid.Row="3" Grid.Column="0" HorizontalAlignment="Right" />
<ComboBox Name="cb_SkinList" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left" MinWidth="100" VerticalAlignment="Center" Width="Auto" SelectionChanged="cb_SkinList_SelectionChanged"/>
<ComboBox Name="cb_SkinList" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left" MinWidth="100" VerticalAlignment="Center" Width="Auto" SelectionChanged="Cb_SkinList_SelectionChanged"/>
<Label Content="Anime" Grid.Row="4" Grid.Column="0" HorizontalAlignment="Right" ></Label>
<ComboBox Name="cb_AnimeList" Grid.Row="4" Grid.Column="1" SelectionChanged="cb_AnimeList_SelectionChanged" HorizontalAlignment="Left" MinWidth="100" VerticalAlignment="Center" Width="Auto"/>
<ComboBox Name="cb_AnimeList" Grid.Row="4" Grid.Column="1" SelectionChanged="Cb_AnimeList_SelectionChanged" HorizontalAlignment="Left" MinWidth="100" VerticalAlignment="Center" Width="Auto"/>

<Label Content="FPS" Grid.Row="5" Grid.Column="0" HorizontalAlignment="Right"/>
<TextBox Name="tb_Fps" Grid.Row="5" Grid.Column="1" HorizontalAlignment="Left" MinWidth="30" TextWrapping="NoWrap" Text="" VerticalAlignment="Center" Width="Auto" MaxLength="3" />
Expand Down Expand Up @@ -224,7 +224,7 @@
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Label Content="Export Type" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right"/>
<ComboBox x:Name="cb_export_type" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="100" SelectionChanged="cb_export_type_SelectionChanged" >
<ComboBox x:Name="cb_export_type" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="100" SelectionChanged="Cb_export_type_SelectionChanged" >
<ComboBoxItem Content="Gif" IsSelected="True"/>
<ComboBoxItem Content="Png Sequence"/>
</ComboBox>
Expand Down
Loading