nicloay

I've made first beta version of spine exporter.
It's not a run time, and just build unity objects (animator, animation, spritesheet + skin controller script)
It does not support all spine features.

Currently it doesn't support following things:
  • regionsequence
  • color animation
  • mesh animation
  • Export several json files with shared atlas (spine project with several skeletons)

partial support
  • smooth animation (Bezier curves in unity is a little bitt different, but in most cases it should work as expected)

features hass been done by 3d people:
abraksil
  • events
  • draworder

it's available here https://github.com/nicloay/unity-spine- ... r/releases

A little bit later i'll add some type of documentation. but it's easy. just right click on json file and choose "spine build prefab"

here is a video about how it works right now. I've been tried to record it 3 times and faced different bugs =). good reason to fix that.





(images are pointed to youtube)
User avatar
nicloay
Posts: 38

CYBR Labs

Just watched your video here:
http://www.youtube.com/watch?v=XOEBjAdJxUk

Looks quite interesting! I'll have to give it a try when I get home. :)
User avatar
CYBR Labs

Epic Kickstarter Backer
Posts: 16

nicloay

CYBR Labs wrote:Just watched your video here:
http://www.youtube.com/watch?v=XOEBjAdJxUk
Do you have internal yotube events =)? Yesterday I was waiting more than 1 hour while youtube process that video, run out of patience and went to sleep and didn't post it here. Now I've added it at first post.
User avatar
nicloay
Posts: 38

CYBR Labs

Looks very helpful for those struggling with json and Unity integration. I'm sure once support for mesh goes in, more would be interested in this.

Definitely going to keep an eye on this tool you've created. :yes:
User avatar
CYBR Labs

Epic Kickstarter Backer
Posts: 16

nicloay

today i'm working on new cool features. Just done AvatarMask

It used in animator.E.g. when you want to combine several animation or don't want to animate one bone of character.
User avatar
nicloay
Posts: 38

Nate

This is quite neat! :)
User avatar
Nate

Nate
Posts: 7647

jimotion

Looks cool :)
jimotion

Kickstarter 2 backer
Posts: 23

nicloay

Thanks for feedback.
meanwhile i fixed 2 bugs.
1. Unity can't animate game objects with forward slashes in names (temp fix: replaced / to |)
2. Wrong sequence in slot animation fixed.

take new package here
User avatar
nicloay
Posts: 38

jimotion

This Is awesome nicloay :)
Just brought a spine project into unity :)
hope you can get the smooth animation curves to work.
Awesome thanks
jimotion

Kickstarter 2 backer
Posts: 23

Yodzilla

Wow this looks great! Quick question though, is it required for you to move your Spine project files into your Unity project directory like you did in that video or can those exist outside of the Unity project as long as you still export from Spine into Unity's asset folder?
Yodzilla

Kickstarter Backer
Posts: 5

nicloay

No. You don't need project files. Jus move 3 export files. Json export, atlas.png, atlas.atlas metadata.
User avatar
nicloay
Posts: 38

Yodzilla

Excellent, thanks. I can't wait to play around with this.
Yodzilla

Kickstarter Backer
Posts: 5

Yodzilla

So I'm apparently hitting an unsupported attachment type already. Is this because I'm using meshes in Spine?
Attachment type not supported yiet FIX MEEE
UnityEngine.Debug:LogWarning(Object)
UnitySpineImporter.SpineUtil:addAllAttahcmentsSlots(SpineData, SpritesByName, Dictionary`2, Int32, List`1&, AttachmentGOByNameBySlot&) (at Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs:344)
UnitySpineImporter.SpineImporterWizard:OnWizardCreate() (at Assets/UnitySpineImporter/Scripts/Editor/SpineImporterWizard.cs:64)
UnityEditor.HostView:OnGUI()
Which then throws:
NullReferenceException: Object reference not set to an instance of an object
UnitySpineImporter.Slot.hideAllAttachments () (at Assets/UnitySpineImporter/SharedScripts/Slot/Slot.cs:44)
UnitySpineImporter.Slot.showDefaultAttachment () (at Assets/UnitySpineImporter/SharedScripts/Slot/Slot.cs:56)
UnitySpineImporter.SkinController.showDefaulSlots () (at Assets/UnitySpineImporter/SharedScripts/SkinController.cs:57)
UnitySpineImporter.SpineImporterWizard.OnWizardCreate () (at Assets/UnitySpineImporter/Scripts/Editor/SpineImporterWizard.cs:74)
Yodzilla

Kickstarter Backer
Posts: 5

nicloay

as i see regionsequence is not implemented yiet, because of that you're getting this error.
Just region(image) and boundingbox(collider) supported right now.
User avatar
nicloay
Posts: 38

nicloay

new version v0.3 released.

New Features:
  • Update existing animation instead of creation new one's.
    Now if you will reimport spine data, you can choose, recreate new animation and animators, or just replace existing animation keyframes
  • Smooth Curves, partial support. (not all Bezier curves can be transferred in to the unity, but it's better than nothing =), or linear animation)

BugFix:
  • rotation animation, full round fix

take latest version here
User avatar
nicloay
Posts: 38

karlozalb

This is amazing! thank you very much!
karlozalb
Posts: 24

nicloay

karlozalb wrote:This is amazing! thank you very much!
thanks.

I've just recorded video (also included it in the first message) http://www.youtube.com/watch?v=7MfUAelg9hQ here i show my project with animator. Hopes that it will answer the main Nate question - "why to use animator" =).
User avatar
nicloay
Posts: 38

Nate

Hehe, love the Unity interface bugs. ;) :D My favorite is if I open a scene from a different project, a new Unity instance opens and the old one crashes. Crashes every time and has been since 4, if not earlier.

Thanks for the video, it is neat to see how the state machine stuff works. It's a strange way of creating the functionality for me, I am much more comfortable writing code to do it, but I can still appreciate it.

From what I can see, everything you did can be done with spine-unity. You can control the active animations, mix between animations when they are changed, modify the animation speed dynamically, apply an animation on only a subset of bones, apply multiple animations at the same time, etc.

Is it possible to use the state machine / flow chart stuff to trigger code? If so, you could use it to set animations using spine-unity.

I don't (yet :)) see a big difference between using a prefab and using spine-unity. Have you tested performance difference on mobile devices? I have a feeling that spine-unity may perform a bit better.
User avatar
Nate

Nate
Posts: 7647

nicloay

Hi Nate. First of all sorry for my english, sometimes i'm telling not the same what I think in russian =).

I don't want to blame unity-runtimes, and i more than sure that native runtime should work faster, and even if in any cases mecanim will be faster you will find the way how to optimise it.

Main reason why i made this package, because it's should be easier for artists to work with animator, than to go in to code and make some changes there.

here is a code which I made for that model in the second video
https://gist.github.com/nicloay/9002437

and here is default state machine


it support following features
  • walk
  • run
  • run/walks depends on speed
  • in air up
  • in air down (depends on velocity)
  • punch left
  • [combo] punch left, right
  • [combo] punch left, right, upper-cut
  • roll out
  • throw (from any state)
  • complex jump with
maybe something else.

Don't forget that if you want to adjust some transition, or blending animation, you don't need to go to code, you can do that in the editor using native features.

Now just tell how many things you need to do as a programmer if you first time opened unity and trying to make something similar with spine-runtime. Sorry, i've tried just import to spine-runtime, but didn't tried to make any controllers.
Nate wrote: everything you did can be done with spine-unity.
...
Have you tested performance difference on mobile devices?
as i told before, you're right, spine-runtime should be faster, but almost everything you need to do through the code.
Nate wrote:Is it possible to use the state machine / flow chart stuff to trigger code? If so, you could use it to set animations using spine-unity.
No, i don't think so, in animator, you define state and provide animation for that state. But, from animation(which is native unity animation) you can. (more details here)

Sorry, i can't make performance test right now, and will be happy if someone will did.

upd1.
I forgot to tell that in video, but there is one more thing. Because of using native sprites, for each sprite unique mesh generated, which reduce number of empty pixels what is good for renderer and increase performance

Probably you can achieve the similar if you will define meshes for each sprite in unity.
User avatar
nicloay
Posts: 38

Nate

Don't worry, your English is fine. :) You dropped the F bomb at just the right time. ;)

There is defintely some benefit to doing things the way Unity users are used to, that's for sure. It's unfortunate if the flow chart stuff can't be used to control code, it seems like a missed opportunity for Unity. I wish I had time to dig into it. I will when I get a chance!

Honestly the way of making things work in Unity is awkward for me. I am sure how spine-unity is used can be made more friendly, even if the flow chart stuff can't be used. A spine-unity controller should be similar to how you had to write code for your controller. Once done it should be relatively easy to customize or reuse.

Spine can do meshes, though I haven't updated the Unity runtimes yet.

I'm not knocking your runtime, it is quite neat. :) Probably the biggest advantages are that everything is a GameObject, so you can attach things without using BoneComponent, and that Unity users may already be used to using the Animation tools. It's good to have options!
User avatar
Nate

Nate
Posts: 7647

jimotion

Thanks for the update and video nicloay :)
jimotion

Kickstarter 2 backer
Posts: 23

CYBR Labs

Glad to see continued work on this! :yes:

EDIT: Does image swapping work? I seem to have an issue with all the images moving off the body erratically.
User avatar
CYBR Labs

Epic Kickstarter Backer
Posts: 16

nicloay

Do you mean slot order animation? no currently it doesn't work
User avatar
nicloay
Posts: 38

CYBR Labs

Yes, that is what I mean. I shall await for it to one day work. :)
User avatar
CYBR Labs

Epic Kickstarter Backer
Posts: 16

rxmarcus

Is this project still in development? Hoping it isn't dead, going to give it a try tonight!
rxmarcus
Posts: 64


Return to Unity