GithubHelp home page GithubHelp logo

spineconverter2.1.27's Introduction

SpineConverter2.1.27

Conversion tool between .skel and .json files, Spine version 2.1.27. Originally made to make free animation modding of the game Darkest Dungeon possible. Due to personal problems I don't have the time to continue working on it. Tested against Darkest Dungeon's .skel files.

Requirements:

Python 3

Usage

Reading and writing .skel files:

from spBinaryReader import spBinaryReader
from spBinaryWriter import spBinaryWriter
reader = spBinaryReader()
writer = spBinaryWriter()
skeletonData = reader.readSkeletonDataFile( "vestal.sprite.walk.skel" )
writer.writeSkeletonDataFile( skeletonData, "vestal.sprite.walk.reexported.skel" )

Reading and writing .json files:

from spJsonWriter import spJsonWriter
from spJsonReader import spJsonReader
reader = spJsonReader()
writer = spJsonWriter()
skeletonData = reader.readSkeletonDataFile( "vestal.sprite.walk.json" )
writer.writeSkeletonDataFile( skeletonData, "vestal.sprite.walk.reexported.json" )

Reading .skel file and writing .json file (can do the opposite):

from spBinaryReader import spBinaryReader
from spJsonWriter import spJsonWriter
binaryReader = spBinaryReader()
jsonWriter = spJsonWriter()
skeletonData = binaryReader.readSkeletonDataFile( "vestal.sprite.walk.skel" )
jsonWriter.writeSkeletonDataFile( skeletonData, "vestal.sprite.walk.json" )

Reading and writing .atlas files:

from spAtlas import *
atlas = readAtlasFile( "vestal.sprite.walk.atlas" )
writeAtlasFile( atlas, "vestal.sprite.walk.reexported.atlas" )

Notes

  • Skeleton data that's returned by *Reader classes is not made to be passed to runtimes, it's just stored data.
  • Skeleton data is perfectly "jsonable", it's all dictionaries and lists, no classes.
  • Produced .json doesn't have all floats rounded, like official ones do, only floats like 1.0 are turned into integers. That's done to preserve precision. So reading binary -> writing json -> reading json -> writing binary produces exact same binary. Value -0.0 is left for the same reason. SkeletonViewer doesn't have any problem loading such files.
  • cc_shrew.skel has instances of two slot color timelines one after the other. That creates problems with json since timeline types are used as keys, so the second one will override the first one. It's unclear if that was an exporter bug or Spine's json exports allow duplicate keys. An ugly hack is used to bypass that problem.
  • 2.1.27 SkeletonViewer expects json to have slot blend property as "additive". Some 2.1.27 jsons have it as "blend". spJsonReader will try to read both. spJsonWriter will write with slot["additive"] = True. If you want to write slot["blend"] = "additive" instead - set blendProperty to True: jsonWriter.writeSkeletonDataFile( skeletonData, "vestal.sprite.walk.json", blendProperty=True )

Thanks

spineconverter2.1.27's People

Contributors

brachna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

spineconverter2.1.27's Issues

Converting from DragonBones(DB) to Darkest Dungeon

Not really an issue. I think i managed to export project from DB to DD. Translation, rotation, scaling and meshes seems to work. To make rotation and meshes work i had to tweak spJsonReader a little (2 new lines and 1 altered).
C1IY6rfWZb
N38qGtr9jO

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.