Jump to content

scml -> kanim converter


Recommended Posts

java tool for converting between oni kanim file format and spriter scml (https://github.com/daviscook477/kparser) uses maven (main dependency is on libgdx's texture packer in order to create single texture atlas that kanim expects).

performs a mostly correct transformation from kanim to scml (can't be perfect b/c kanim uses 2x3 transform matrix and scml only has rotation scaling and translation)

not sure if the transformation from scml to kanim is correct though unfortunately because I can't figure out how to use AddKAnim to load and then use custom kanims that could be created this way. however I can verify that it can correctly go from kanim -> scml -> kanim -> scml without any loss of accuracy on the spriter side (so the scml -> kanim conversion is at least correct with respect to converting kanim -> scml).

right now the tool can only be run from IDE but if I can figure out how to use AddKAnim properly then I will make it into a command line tool or GUI.

I can upload some images/gifs of working file type conversions if interested.

code has comments in some parts that attempt to explain how the two file formats relate to each other.

some restrictions on the spriter side for making kanims that work correctly should be using an interval of 33ms (~30 fps which is what oni seems to like) and doing key frame snapping since ONI kanim expects each key frame to be a literal frame, i.e. have same duration so this converter wouldn't work on an arbitrary spriter file. But it should be possible to use to create kanims in spriter.

if anyone has ideas on how to get working custom animations into ONI it would be awesome. making custom buildings and the likes really won't be all that interesting until modders also display them with custom assets.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...