Recommended Posts

test447    2

java tool for converting between oni kanim file format and spriter scml ( 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.

  • Thanks 2

Share this post

Link to post
Share on other sites
QuantumFlux    12
Posted (edited)

Do you have a custom KAnim to test it on? I might try to figure out that method if I find the time tomorrow.

Edited by QuantumFlux

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now