• Bugs
  • Proglem with spine 4.0

Related Discussions
...

Hello, I am using spine Unity 4.0 now.
After spine pro 4.0 and spine unity plugin 4.0 update I got a problem.
When my character changes from one pose(animation) to another pose(animation) - a few of the random bones (leg) make the wrong rotation (they need to rotate by 5 degrees, but they are making a 355 degree rotation).

I have not had this problem before with some skeletons with previous versions of Spine pro (3.8.xx) and spine unity. I tried the 4.056 version of Spine Pro, and I had the same problem with other random bones.
All bones are simple (no paths, IK constraints etc.)

What was the solution for you?
I have already tried to reimport files in the new version, but it won't help.

My trouble: I have many very old json-files from spine v2.1.27 to v4.1-beta without project-files, so I can't do what Mario wrote there about re-export and CLI.

So, first, I wrote a python script to carefully adjust the rotation values in json-files. I think he's working. But there came a time when I abandoned the conversion from 2.1.27 altogether due to difficulties with several models. FlipX from v2.1.27 is very hard to replace and imitate.

I can play with your files, if you're not afraid. And if you can give me the json/atlas/png files. One model with pronounced rotation problems will be enough. I'll try to adjust my python script for your case and give it to you.

2 meses más tarde

My problem is not solved yet.
Is any help from the administration possible?


I made a gif with an entire spine skeleton in unity.
As you can see, the left bottom bones (left leg) go in the wrong way.
Any help?

Does the same happen in Skeleton Viewer? Can you please provide the skeleton JSON?

No, I can see it only in unity. In Skeleton Viewer, everything works fine.
I attached skeleton JSON.
Let me know if you need anything else.
Thanks!

Thanks, but there are a hundred animations. Mixing from which animation to which other animation shows the problem?

12 días más tarde

Many animations have wrong mixing.
For example, stand/stand18 -> stand/stand21.


Hello, Nate.
Any chance you check my problem?
I still need to find a solution for my project.
Thanks!


Hello.
Any updates about my problem?
Thanks!


If this helps - when I watch how my animations mix or reform from one animation to another in spines Preview View - there are no problems. And all bones deform and rotate correctly. So all problems start in Unity. Yes, I have the newest plugin and the latest stable version of Spine.
One more thing. I have a lot of skeletons, and new ones don't have this bug. But a lot of old ones have it in different animations - it's too much work to delete those bones and add them again.
All these problems began with the new version of Spine (which had to be reinstalled). I used different systems, PCs, spine versions from 4.0 to 4.1.2, and different unity versions - nothing helps.


One more thing.
Only one bad solution works - only when I completely delete bones with these bugs (legs) - create new ones - rigid all mesh with skins to them again.
It's a very terrible solution, guys - too much work with remaking parts of skeletons + tons of work with animation - I need to add bone and mesh deformation to all animations again.
I worked with your app for 5 years, made a lot of content, and now I must rework ALL project again.
Thanks for nothing and for the new 4.0 +update, guys!

I'm very sorry that you didn't receive a reply earlier! I must have skipped over your previous post reading "Hello, Nate" and missed that it concerned behaviour in Unity.

I tested your json file above in both SkeletonViewer and spine-unity in Unity, but both played back the transition from stand/stand18 to stand/stand21 correctly (not taking the long way). Are you sure that you are using the latest 4.0 spine-unity unitypackage from the download page?

If you are using the latest version, could you please send us a minimal Unity project that demonstrates the issue? You can send it as a zip package to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context.

Thank you for the response.
I have just sent you a unity project with my problem.
Unity version is 2020.3.28f1.

Thanks for sending the reproduction project, we received everything. We can now reproduce your issue, the problems seems to occur only with SkeletonMecanim, not with SkeletonAnimation.

We will get back to you as soon as we have found out the exact cause.


I'm afraid to say that the only way on the spine-unity end is to use SkeletonAnimation instead of SkeletonMecanim (as shortest rotation direction is stored by AnimationState of SkeletonAnimation, where SkeletonMecanim itself is stateless and Mecanim only provides snapshot-like update info).

So the solution to your problem is to either
a) switch from SkeletonMecanim to SkeletonAnimation, or if you need to use to use Mecanim,
b) use a wrapper setup as shown in the example scene Mecanim Logic SkeletonAnimation View that comes with the spine-unity package.

Thank you for a quick response.
I use SkeletonMecanim because I can set 5 different layers in Animator, and they will mix correctly.
I tried to use SkeletonAnimation to get the same effect, but the animations play like they are on the same track.
It is hard to describe, but I hope you understand.

With AnimationState (via SkeletonAnimation) you can mix animations on the same track (equivalent to a crossfade) and you can mix animations on different tracks (can be thought of as layering animations on top of others). We'd need to see what you tried with SkeletonAnimation to be able to help there.

I tried something like this:

//pose
Skeleton.state.AddAnimation(0, animation1, true, 0);
//breath
Skeleton.state.AddAnimation(1, animation2, true, 0);
//idle
Skeleton.state.AddAnimation(2, animation3, true, 0);
//blink
Skeleton.state.AddAnimation(3, animation3, true, 0);
//speak
Skeleton.state.AddAnimation(4, animation3, true, 0);

It was like a year ago when I checked it, animations breath and idle blending in a new animation.
But I need to run them as I did on different layers in Animator(common Unity animator).
Only two tracks worked when I tested it in SkeletonAnimation, even if I added 3-4.

That code looks OK (even using animation3 on tracks 2, 3, and 4). The animations will be run on different tracks, layered on top of the lower tracks.

My bad. I mean 5 different animations:

//pose
Skeleton.state.AddAnimation(0, animation1, true, 0);
//breath
Skeleton.state.AddAnimation(1, animation2, true, 0);
//idle
Skeleton.state.AddAnimation(2, animation3, true, 0);
//blink
Skeleton.state.AddAnimation(3, animation4, true, 0);
//speak
Skeleton.state.AddAnimation(4, animation5, true, 0);

Aye, it should work the same. You can use preview to see the mixing on different tracks within Spine.