• Unity
  • Unity3d importer [beta]

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.

Related Discussions
...

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 days later

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 days later
4 days later

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

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

Image removed due to the lack of support for HTTPS. | Show Anyway

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

Image removed due to the lack of support for HTTPS. | Show Anyway


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

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!

Thanks for the update and video nicloay ๐Ÿ™‚

5 days later

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.