• Runtimes
  • Open Source Native Unity Importer

Related Discussions
...

Hi all,

I've wanted to have something that makes Spine fit in a bit more with the native Unity workflow, such as being able to use Mechanim, Skinned Mesh Renderers, Unity 2D sprites etc...

So I've written up an importer and released it for free with source.

It's only 2 days old, so there's bound to be a few teething issues with it, but I'm going to be using it myself fairly heavily over the next week so these should get sorted out very soon.

Supported features
Bone hierarchy imported
Regions imported as Unity sprites
Meshes
Skinned meshes
Multiple skins
Animations imported as native Unity animations
Animation events
Supports native Unity Mechanim state machine blending etc...

Unsupported features
Draw order animation (though initial draw order is imported correctly)
Attachment swap keys
FFD (this isn't a priority for me as I do most of my animations with skinning, but I might find a way to do it with blend shapes if I have time)

Known issues
Animation curves at the moment do not match Spine 100% correctly. I'll be fixing this soon.

It's available on my github page here - https://github.com/pixelballoon/spineimporter

Some vines of it in use:
https://vine.co/v/M0r9igEgrr1 (Initial bone import)
https://vine.co/v/M0XZmHapA9Z (Spines and swappable skins)
https://vine.co/v/M09AjYjXYFJ (Skinned meshes support)

It should be very easy to use. Simply drop the json file (atlas not required), with all images in a folder named 'images' beside it. Right click on the json and hit spine/import. This will create a prefab with an animator, and all animations already populated inside it. Click 'refresh' in the inspector if you need to update the animation.

Note that obviously this is just an alternative to the official runtimes, and will likely never be supported as well as those are. My main reason for doing this is that I want something that allows me to use all of the official Unity features and optimisations, but use Spine for the animation (because it rocks!). One of the main bonuses for me is that it allows me to use native sprites, so I don't have to generate atlases within Spine. This makes it a lot easier for me to tweak images and test them out.

I won't be providing any official support as I'm releasing it for free, but if you run into any issues or have any suggestions let me know and I'll see what I can do. Pull requests for features/bugfixes are always welcome too of course.

If you have any comments, questions or suggestions just let me know!

I'll be checking this thread, but you can also grab me on twitter @pixelballoon, or drop me a mail, jamie AT pixelballoon DOT com

Cheers all!

Very cool! 🙂 thanks for sharing.

No problem! Love the app, and releasing this is the least I could do to give back 🙂

No new features, but I've put in a few bug fixes over the past day:

Fixes

  • Fixed scaling on region slots
  • Allow prefabs to be created in a different directory to the spine json file
  • Allow created skeleton to be nested into another prefab
  • Only add animationclips to the controller if they're new (so the user can remove them, or add them to blend nodes/different animation layers)
  • Fix an issue with single frame animations being treated as 1 second animations
  • Updated the instructions to be a bit clearer

I'm still planning on getting draw order and attachment swapping in by the end of the week, but I've been using it for two days now without encountering any issues (apart from the ones fixed above!)

I will also try to upload a short youtube tutorial video sometime over the next week describing the main features.

If anyone has any requests or comments please let me know!

Cheers!


(for some reason the forum won't allow me to post a new reply, it just edits the previous post... how odd!)

Hi all,

I've just added support for attachment key framing, this has only been tested on a limited amount of spine files, so it will remain in the develop branch until it's been properly tested.

https://github.com/pixelballoon/spineim ... ee/develop

Next up will likely be curve importing and draw order, but these may be a few weeks off as I have no pressing need for them in my project at the moment. Once they're in however, that's all major features of the spine runtime supported apart from FFD.

Cheers!

(for some reason the forum won't allow me to post a new reply, it just edits the previous post... how odd!)

its a PhpBB setting, it is technically a different post, it just draws it as 1.

(for some reason the forum won't allow me to post a new reply, it just edits the previous post... how odd!)

Don't worry your post will still show up as unread 🙂 It just keeps things a little more tidy.