- Düzenlendi
How to blend animation layers with mecanim?
I've setupped mecanim in Unity for my character. The main layer includes Idle and walk animation, the second one has only hit animation. The HitLayer (see screenshot) setupped as Additive Blending, but works like Override blending. Transition between idle and move in one layer works fine.
You are right, the animation layer blend mode did not have any effect yet. I just fixed and committed this problem to the git repository, it will be released as a unitypackage tomorrow.
I already uploaded the updated unitypackage.
You can download it here as usual:
Spine Unity Download
Thank you! Now blending works fine.. almost. Now character's hands after blending (idle + hit or move + hit etc.) rotate the wrong angle and never come back to the right rotation. I found the information on this forum that I have to check animation keys in the beginning and in the end of animation. So I checked, rebuild project and resetupped. But effect still stay the same.
Could you send us your project and exported files as a zip package to contact@esotericsoftware.com? Then we can have a look at this specific problem.
Okay, I have sent the project.
Thanks, received your package and could reproduce the problem, as described via email.
I filed an issue ticket here:
https://github.com/EsotericSoftware/spine-runtimes/issues/1321
The problem with remaining animation leftover rotations when transitioning to an empty "Write Defaults" state is now resolved.
You can download the latest unitypackage here as usual:
Spine Unity Download
Unfortunately I see one remaining problem of the transition to the 'Default' state being a hard cut, because Unity's animation controller returns clip.weight=1 all the time and then instantly clip.weight=0 instead of e.g. a proper clip.weight=0.9, 0.7, 0.5, etc during the transition.
However, I could not yet find a way via the Unity API to query the exact used transition weight. I will let you know if I find out anything regarding this problem.
Nevertheless, I hope that the situation is now at a state which allows you to work with, or work-around: you could define a simple animation in Spine which has only the setup pose rotations set, and assign it to the Default state in the Mecanim controller. This should then lead to the desired result.
Thanks a lot. It works like you said. I think it's enough for me now.
You're welcome. I hope that we will discover a workaround for the correct way of the transition at some point. I will then let you know.