• Unity
  • Unity3d importer [beta]

Related Discussions
...

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)

CYBR Labs :

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.

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:

4 天 后

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.

This is quite neat! 🙂

5 天 后
4 天 后

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

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

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?

No. You don't need project files. Jus move 3 export files. Json export, atlas.png, atlas.atlas metadata.

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

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)

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.

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

This is amazing! thank you very much!

karlozalb :

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" =).

Hehe, love the Unity interface bugs. 😉 😃 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.

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

图像因不支持 HTTPS 被隐藏。 | 仍然显示

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 :

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 :

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

图像因不支持 HTTPS 被隐藏。 | 仍然显示


Probably you can achieve the similar if you will define meshes for each sprite in unity.