Mitch



---



---

User avatar
Mitch

Mitch
Posts: 968

Norman

These are very helpful, thanks.
User avatar
Norman
Posts: 8

dirkmalta

@Mitch Using Spine is much better then using Mechanim is Unity. Is there a large overhead in using Spine and importing to Unity rather then directly using Unity's Mechanim. The reason I'm asking this is that I would like to create most of my animation, even non character animations, like environment animation using Spine as it keeps things much more organised.
Thanks
Creating a platform adventure game where time is manipulated when you move. Every step count!
And of course we using Spine ;-)
https://twitter.com/gloomvideogame
User avatar
dirkmalta
Posts: 5

Mitch

There is certainly some significant overhead. Exporting skinned meshes as FBX and animating them (ie: tree leaves/ vines or something for an environment) would be delegated to GPU Skinning with the native Unity mecanim stuff. Spine all happens in C# and on CPU.

That being said, certain types of animation can be Baked using Spine which convert them to native Unity mecanim type animations and meshes, but still share the same Atlas data as your Spine data. Best of both worlds? Kind of. Maintaining a baked animation is a bit troublesome right now - but it does work.

I personally regularly use Spine as a "rigging" tool for simpler 2D assets and then simply bake them in Unity and let them be driven by 2D Physics or other various dynamics scripts.
User avatar
Mitch

Mitch
Posts: 968

dirkmalta

@Mitch ok cool. so if I actually dont use skinned meshes for deforming, use Rotate, Position and Scaling only and then Bake the animations inside Unity there shouldnt be any performance overhead I would imagine.
Creating a platform adventure game where time is manipulated when you move. Every step count!
And of course we using Spine ;-)
https://twitter.com/gloomvideogame
User avatar
dirkmalta
Posts: 5

Mitch

Baking skinned meshes works fine too - so long as you're ok with the limits of 4 bone influences per vertex that Unity imposes. Spine doesn't have that limit. Baking also doesn't let you do per-vertex deformation. Its one big trade off, but ultimately Baked things will run faster because C++ native playback library instead of C#. Baking will also generate a lot more keyframes if you dont use Linear curves as the Unity AnimationCurve works very differently than the Spine Curve.
User avatar
Mitch

Mitch
Posts: 968

dirkmalta

@Mitch cool. thanks for the info
Creating a platform adventure game where time is manipulated when you move. Every step count!
And of course we using Spine ;-)
https://twitter.com/gloomvideogame
User avatar
dirkmalta
Posts: 5

Pharan

Ghost Effect


Ragdoll


Submesh Renderers (sandwiching stuff within a SkeletonRenderer model)
User avatar
Pharan

Pharan
Posts: 5092

Dave

Is there a link to download "Ragdoll" project?
Dave
Posts: 10

Mitch

I think I included the ragdoll examples in the main unity package and in github
User avatar
Mitch

Mitch
Posts: 968

francordoba

Hello Mitch, i can see in
https://youtu.be/GH6FPr76lU0

Spine Unity SpriteAttacher video in the Footsoldier example that the sprite PNG file "Equipment", can be attach easy and does not create problems, (for example: artifacts...).

Which graphic software used to create the file "Equipment" and export it to Spine?
Can you link some access to the editable file to see the Alpha export options to Spine?

I export the necessary pngs directly from photoshop to Unity in a folder. I use Spine only for skeletons.

I have long been trying how to export my png Sprites to my skeletons via code but still gives me the problem of artifacts and look bad but with the "Equipment" file work fine.
public class load_slot_scr : MonoBehaviour {
//slots
public Sprite sprite;

[SpineSlot]
public string slot;

SkeletonRenderer skeletonRenderer;
// Use this for initialization
void Start () {
//slots
slot="slot_weapon";
skeletonRenderer = GetComponent<SkeletonRenderer>();

var AttachS = skeletonRenderer.skeleton.AttachUnitySprite(slot, sprite);

}
void OnGUI(){
//Button for load sprite
if(GUI.Button(new Rect(250,250,100,100),"Load Sprite")){

sprite = Resources.Load<Sprite>("Resources/Sistema/Maniquis/Sprites/sword");

skeletonRenderer = GetComponent<SkeletonRenderer>();
var AttachS = skeletonRenderer.skeleton.AttachUnitySprite(slot, sprite);

};

}
}
Sorry for my poor english. :sweat:
Attachments
Equipment.png
import_settings.pngImport_Settings
francordoba
Posts: 9

Mitch

The atlas of accessories is generated by Spine's texture packer.

The single sword sprite I assume I exported from Photoshop as TGA with Alpha in that video. However there is a PNG plugin for photoshop that lets you properly export PNG's

http://www.fnordware.com/superpng/

This does the job nicely.
User avatar
Mitch

Mitch
Posts: 968

francordoba

Thank you so much.
francordoba
Posts: 9

decoamorim

Mitch wrote:...so long as you're ok with the limits of 4 bone influences per vertex that Unity imposes. Spine doesn't have that limit....
Ohhh, so the limit is per vertex not per mesh? A mesh can have many bones as your character needs?
Cruz Brothers Game - http://www.cruzbrothersgame.com
Donut Coffeeshop Studios - http://www.donutcoffeeshopstudios.com
Bunny Battle Arena (IOS) - https://itunes.apple.com/br/app/id847957836
User avatar
decoamorim
Posts: 111

hottabych

Seems like these tutorials are outdated?
I can't find such SpriteAttacher / AtlasRegion Attacher scrips.
hottabych
Posts: 8

FollowCD

These tutorials are really useful for me, thanks! but I got stuck when I follow your action in tutorial "Spine-Unity Events", in the tutorial 3min15sce, you right clicked the mouse and chose the "Spine->Instantiate(Mecanim)" in the menu,but in my unity editor, I just did not have that option, how I can fix this problem?

Spine runtime 3.6.xx
Unity Version 2017.3.1P4 64-bit
FollowCD
Posts: 1

Pharan

This is how you instantiate a SkeletonAnimator now: [New Feature] Drag and Drop to instantiate
User avatar
Pharan

Pharan
Posts: 5092


Return to Unity