Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[unity] Review SkeletonAnimator blending #864

Closed
pharan opened this issue Mar 22, 2017 · 4 comments
Closed

[unity] Review SkeletonAnimator blending #864

pharan opened this issue Mar 22, 2017 · 4 comments
Assignees

Comments

@pharan
Copy link
Contributor

pharan commented Mar 22, 2017

Introduce calculation of "accumulated weight".
http://esotericsoftware.com/forum/Incorrect-blending-when-using-SkeletonAnimator-Unity-8083

@pharan
Copy link
Contributor Author

pharan commented Mar 23, 2017

Pseudocode:

float runningTotal = 1.0 - trackAlpha; // normally 0, but apply an "alpha" factor to the eventually applied track.
foreach (trackEntry in track) {
     float phase = track.mixPhase;
     runningtotal += mixPhase;
     float appliedAlpha = phase / runningTotal;
     trackEntry.Apply(..., appliedAlpha);
}

Theoretically, it looks like this:

mix phase		| ++runningTotal 		| applied alpha
0.5			| 0.5				| 1
0.5			| 1				| 0.5
0.5			| 1.5				| 0.3333~

mix phase		| ++runningTotal 		| applied alpha
0.3			| 1				| 1
0.			| 2				| 0.5
1			| 3				| 0.3333~

mix phase  	 	| ++runningTotal 		| applied alpha
0.2			| 0.2				| 1
0.6			| 0.8				| 0.75
0.4			| 1.2				| 0.3333~

@NathanSweet
Copy link
Member

From @pharan on the forum post:

The problem with this seems to be that it cannot mix/fade back to setup pose as needed, especially parts-wise, since animation property sets are not guaranteed to perfectly intersect. This seems fine as a behavior for SkeletonAnimator as long as it's consistent with Mecanim.

We've got a fix for the "dipping", discussed here:
http://esotericsoftware.com/forum/Blend-Weirdness-in-Unity-3-5-7263?p=37700#p37700

@pharan pharan reopened this Apr 2, 2017
@pharan
Copy link
Contributor Author

pharan commented Apr 2, 2017

@NathanSweet That is unrelated to SkeletonAnimator. SkeletonAnimator doesn't use Spine.AnimationState.

@pharan
Copy link
Contributor Author

pharan commented Jan 12, 2018

This will have a pass with the work on the Playable translator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants