• Unity
  • Spine-Unity 3.7 to 3.8 Upgrade Guide

Hello,

We are updating to spine 3.8 - was the Ragdoll and the Kinematics Shadow Modules removed from the integration completely?
Got error in scripts using those two, since they no longer exist. Is there a substitute in the pkg?

Related Discussions
...
13 días más tarde
  • Editado

A short note on a change committed today regarding SkeletonMecanim:

  • SkeletonMecanim's Layer Mix Mode enum name MixMode.SpineStyle has been renamed to MixMode.Hard. This is most likely not set via code and thus unlikely to be a problem. Serialized scenes and prefabs are unaffected.
  • SkeletonMecanim's Layer Mix Mode now defaults to MixMode.MixNext. Note: for a short time, the default value was changed to MixMode.SpineStyle (MixMode.Hard). This was unfortunately less intuitive in behaviour and has thus been changed.

I have also added extensive documentation of the MixMode parameters to the spine-unity documentation pages here:
spine-unity Runtime Documentation: SkeletonMecanim Component

The respective sections have been added in the top-most posting as well.
We hope that these changes make SkeletonMecanim more intuitive and easier to use 🙂.

2 meses más tarde

Finally upgraded to Spine 3.8! Aside from fixing the changed method/variable names, it went pretty smoothly. Only one issue spotted so far and it's related to Attachment's "GetRemappedClone". On Spine 3.7, region attachments would copy any color tinting, but mesh attachments wouldn't. So I had code like this:

Spine.Attachment newAttachment = templateAttachment.GetRemappedClone(atlasRegion, true, true, skeletonDataAsset.scale);
 if (newAttachment == null)
     Debug.Log("clone attachment failed for " + originalSkin + " " + regionName + " " + slot + " " + templateAttachmentName);
 if (templateAttachment.GetType() == typeof(Spine.MeshAttachment))
 {
     Spine.MeshAttachment newAttachmentCasted = (Spine.MeshAttachment)newAttachment;
     Spine.MeshAttachment oldAttachment = (Spine.MeshAttachment)templateAttachment;
     newAttachmentCasted.R = oldAttachment.R;
     newAttachmentCasted.G = oldAttachment.G;
     newAttachmentCasted.B = oldAttachment.B;
     newAttachmentCasted.A = oldAttachment.A;
 }

But I noticed in Spine 3.8, a bunch of our attachments were appearing white suddenly. So it turns out we need to also do this check for RegionAttachments now:

if (templateAttachment.GetType() == typeof(Spine.MeshAttachment))
        {
            Spine.MeshAttachment newAttachmentCasted = (Spine.MeshAttachment)newAttachment;
            Spine.MeshAttachment oldAttachment = (Spine.MeshAttachment)templateAttachment;
            newAttachmentCasted.R = oldAttachment.R;
            newAttachmentCasted.G = oldAttachment.G;
            newAttachmentCasted.B = oldAttachment.B;
            newAttachmentCasted.A = oldAttachment.A;
        }
        else if (templateAttachment.GetType() == typeof(Spine.RegionAttachment))
        {
            Spine.RegionAttachment newAttachmentCasted = (Spine.RegionAttachment)newAttachment;
            Spine.RegionAttachment oldAttachment = (Spine.RegionAttachment)templateAttachment;
            newAttachmentCasted.R = oldAttachment.R;
            newAttachmentCasted.G = oldAttachment.G;
            newAttachmentCasted.B = oldAttachment.B;
            newAttachmentCasted.A = oldAttachment.A;
        }

I'm not sure if this is intended but it's something I came across.

Thanks very much for reporting!

This issue has just been fixed. New unitypackages can be downloaded here as usual:
Spine Unity Download

MeshAttachment was already copying color, so you should now be able to remove the complete code block.

10 meses más tarde

I'm having trouble getting the timeline package to work. I've installed the spine 3.8 UPM and fixed all compile errors related to that (we are upgrading from 3.7). But when bringing in the timeline package (I can't find a UPM, only a zip) I'm getting new errors stating that various spine namespaces can't be found. Could I be installing it incorrectly? I just unzipped the archive to the packages folder in my unity project. I tried importing the zip with the package importer, but it gives me an error that states that all of the files already exist in my project (they don't).

Any thoughts?

I'm also seeing an issue with certain meshes not displaying properly for re-exported skeleton files; it seems that some weighted meshes appear to have negative scaling or are skewed or something, although there is nothing on the bone rotation/scaling to suggest why this would be happening. Any help would be greatly appreciated.

Unity version is 2019.4.9f1

Please note that our resident Unity expert, Harald, is currently on vacation. He'll catch up to forum posts and everything else ASAP when he's back. I can try to help, but I apologize if only in a basic way.

There should not be any errors after installing, so that is a clue something went wrong early on. Did you get spine-unity from the download page? You should remove the old files first, otherwise you could have a mix of old and new files which would cause problems.

Thanks Nate, any help is appreciated. I completely removed all spine files and reinstalled (the spine-unity upm and timeline package are both from the downloads page). In the process of reinstalling, I've noticed that the namespace compile errors are only popping up when 'SPINE_TK2D' is defined. As soon as it's disabled, they disappear. Could there be a compatibility issue with the timeline package and tk2d support? Hopefully that helps to narrow it down.

Oy, it very well could be an issue with Toolkit2D. It is not as popular as using straight Unity, so likely sees less testing. I'm afraid this is Harald's domain, we may need to wait for him to return.

13 días más tarde

Sorry for the late reply and sorry for the inconvenience!

The problem is that the com.esotericsoftware.spine.timeline package comes with asmdef files. The quick fix is to remove (or change the extension from .asmdef to .txt) the two asmdef files:
com.esotericsoftware.spine.timeline\Editor\spine-timeline.asmdef
com.esotericsoftware.spine.timeline\Runtime\spine-timeline-editor.asmdef

Note: the "TK2D Support" - "Enable" button does something similar with the asmdef files of spine-unity, but it does not (and cannot easily) cover those in imported packages.

un año más tarde

Is there no plan to make spine-unity 3.8 for Unity 5.6? It seems my artist was on auto update and now I have no ability to import the new assets into our 5.6 game due to the lack of package support.

I can understand removing Unity 5.6 support with the upgrade to 4.0, but I did not expect it with 3.8. Is there a way that I can downgrade the 3.8 files she made to 3.7 if there is not going to be a Unity package compatible with Unity 5.6 for Spine 3.8?

Riku escribió

I can understand removing Unity 5.6 support with the upgrade to 4.0, but I did not expect it with 3.8.

With the arrival of spine-unity 3.8 (non-beta around 07/2019 if I recall correctly), we already dropped official support for Unity 5.6 (you can also see it in this posting). Support has not been dropped recently. This does not mean that the first 3.8 spine-unity unitypackages did not compile any more. Perhaps you have continued to use the unsupported Unity 5.6 version without noticing, since it did not break immediately?

Riku escribió

Is there no plan to make spine-unity 3.8 for Unity 5.6?

No. While you should likely be able to use earlier spine-unity 3.8 packages without problems, it is not recommended as many bugfixes followed.

Riku escribió

It seems my artist was on auto update and now I have no ability to import the new assets into our 5.6

In general: don't auto-update when in a project. Stay on a fixed version, no-one shall upgrade before asking everyone.
Then your skeleton assets are on version 4.0, not on 3.8, right? spine-unity 3.8 won't help with 4.0 assets.

Riku escribió

Is there a way that I can downgrade the 3.8 files she made to 3.7

Yes.
Versioning - Spine User Guide: Recovering work from a newer version

Thank you so much, it looks like I can export the 3.8 version files using 4.0 (as 3.8 does not have versioned exports that I can find) and import without issue to 3.7. I think she updated recently, thankfully, but I have requested she set her projects to 3.7 so we won't have any further issues.

Glad to hear, thanks for letting us know!