百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

SpineSkeletonDataConverter

> 编程语言
开源

用于将 Spine 骨架数据转换为不同格式 (skel/json) 和不同版本 (3.5/3.6/3.7/3.8/4.0/4.1/4.2) 的命令行工具。

356 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

用于将 Spine 骨架数据转换为不同格式 (skel/json) 和不同版本 (3.5/3.6/3.7/3.8/4.0/4.1/4.2) 的命令行工具。

Spine Skeleton Data Converter

A powerful command-line tool for converting Spine skeleton data between different formats and different versions, with automatic version detection and support for multiple Spine runtime versions.

✨ Features

  • Automatic Version Detection: Intelligently detects Spine version from .skel or .json files
  • Multi-Version Support: Compatible with Spine versions 3.5, 3.6, 3.7, 3.8, 4.0, 4.1, and 4.2
  • Smart Format Detection: Automatically detects file formats based on file extensions
  • Cross-Platform: Built with C++20 and CMake for maximum portability
  • Comprehensive Testing: Includes test suites for all supported versions

Format Support Matrix

3.5 3.6 3.7 3.8 4.0 4.1 4.2
JSON Reader ✅ ✅ ✅ ✅ ✅ ✅ ✅
JSON Writer ✅ ✅ ✅ ✅ ✅ ✅ ✅
Binary Reader ✅ ✅ ✅ ✅ ✅ ✅ ✅
Binary Writer ✅ ✅ ✅ ✅ ✅ ✅ ✅

Legend: ✅ Supported | In Development | ❌ Not Supported

Quick Start

Building from Source

bash
# Clone the repository
git clone https://github.com/wang606/SpineSkeletonDataConverter.git
cd SpineSkeletonDataConverter

# Create build directory
mkdir build && cd build

# Configure and build
cmake ..
cmake --build . --config Release

Usage

…

️ Spine Atlas 4.x to 3.x Downgrade

A dedicated Python script for converting Spine 4.x atlas files to a 3.x compatible format.

Features:

  • Converts .atlas file format, applying the scale property to all relevant metrics.
  • Scales the associated PNG texture images according to the scale property.

Usage:

bash
python SpineAtlasDowngrade.py input.atlas output_dir

The repository now also provides a native executable SpineAtlasDowngrade that mirrors the Python script. Build it via CMake and run:

SpineAtlasDowngrade.exe input.atlas output_dir

When downgrading, textures are resized using stb; currently the native converter only supports PNG texture pages, so convert other formats in advance.

Batch Conversion Script

For large directories of Spine assets, use the bundled helper script tools/SpineConverter.py to drive both SpineSkeletonDataConverter.exe and SpineAtlasDowngrade.exe automatically.

bash
python tools/SpineConverter.py   \
	[-v x.y.z] \
	[--format same|json|skel|other] \
	[--remove-curve]
  • Recursively processes .json, .skel, and .atlas files, preserving the folder structure in the output directory.
  • -v overrides the target skeleton version (defaults to each file's original version).
  • --format controls output formats for .json/.skel files (same keeps the original format, json/skel force a specific format, and other swaps between the two).
  • --remove-curve forwards to the native converter, stripping animation curves instead of translating them when converting between 3.x and 4.x.
  • .atlas files are always downgraded through SpineAtlasDowngrade.exe.

Testing

The project includes comprehensive testing tools to validate conversion accuracy and data integrity across all supported Spine versions.

For each Spine version, we recommend running three rounds of tests to ensure complete functionality:

Round 1: JSON Round-trip Test (JSON → JSON)

Tests JSON reading and writing functionality. The generated .json.json files should be identical to the original .json files.

bash
# Step 1: Convert all JSON files to JSON (tests JSON reader/writer)
$ python ./tools/TestSpineSkeletonDataConverter.py --exe ./build/Debug/SpineSkeletonDataConverter.exe ./data/42 .json .json

# Step 2: Compare all original vs converted JSON files
$ python ./tools/json_diff_all.py ./data/42 .json .json.json

# Step 3: Detailed comparison of specific different files (if any)
$ python ./tools/json_diff.py ./data/42/chibi-stickers/export/chibi-stickers.json ./data/42/chibi-stickers/export/chibi-stickers.json.json

Round 2: SKEL to JSON Test (SKEL → JSON)

Tests SKEL reading functionality. The generated .skel.json files don't need to be identical to original JSON files, as SKEL and JSON formats have inherent differences.

bash
# Step 1: Convert all SKEL files to JSON (tests SKEL reader)
$ python ./tools/TestSpineSkeletonDataConverter.py --exe ./build/Debug/SpineSkeletonDataConverter.exe ./data/42 .skel .json

# Step 2: Compare results (for reference, differences are expected)
$ python ./tools/json_diff_all.py ./data/42 .json .skel.json

Round 3: Full Round-trip Test (JSON → SKEL → JSON)

Tests complete functionality: JSON reader, SKEL writer, SKEL reader, and JSON writer. The final .json.skel.json files should be identical to the original .json files.

bash
# Step 1: Convert JSON → SKEL → JSON (tests all 4 functions)
$ python ./tools/TestSpineSkeletonDataConverter.py --exe ./build/Debug/SpineSkeletonDataConverter.exe ./data/42 .json .skel.json

# Step 2: Compare original vs final converted files
$ python ./tools/json_diff_all.py ./data/42 .json .json.skel.json

# Step 3: Detailed analysis of any differences
$ python ./tools/json_diff.py ./data/42/example/export/example.json ./data/42/example/export/example.json.skel.json

Acknowledgments

  • Spine Runtime - For the excellent 2D animation software
  • nlohmann/json - For the JSON library
  • stb libraries - For lightweight image loading, resizing, and writing
  • Contributors and testers who helped improve this tool

⚖️License

This project is licensed under the PolyForm Noncommercial License 1.0.0.

You may use, modify, and share this project for noncommercial purposes only, and must retain attribution to the original author.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++json2skelskel2jsonspinespine-runtimes

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言