Mecanim: Animation blending oddly

I’ve been following the tutorial to get a set up much like the robots from the mecanim sample scene… i’ve managed to get it working the way i want it to with a bipedal walk animation (with a forward, backwards and side-stepping left and right.)

Much like the robot from the tutorial, the walking is being controlled by a blend tree which is set up the same as the robot system from the tutorial files (it’s the same robot from the angry bots scene.)

the animation blends perfectly as you’d expect a bipedal character would animate except for two certain spots where the animation doesn’t seem to want to sync up properly or something like that.

The animation doesn’t blend properly at the 45 and 225 degree spot (so, between the sidestep to the right and back… and the sidestep from the left and forwards. no other directions are affected.)

I’ve tried to mirror one of the animations and that only results in it’s respective erroneous blend to be switched to it’s other side.

now, if the animation was out of sync, would that then not suggest that the animation data wouldn’t mesh on both sides of that animation? so, say it was the animation set to play at 90 degrees which is a side-step… if that animated segment was animated out of sync, would that then not suggest that the sidestep would not blend with either the forward or backwards, not only one specifically?

I’d love to figure this one out but i’m at a loss here… so, please help.

Bump!

Not sure why the animation isn’t syncing up at those angles only… anyone?

I’ve always thought you needed to keep blends to similar animations. I’m not sure how a side-step and a walk forward would ever blend correctly (the seem too dissimilar in movements to me)- but take that with a grain of salt, because I haven’t seen your animations, and perhaps you did them just peachy. Anyway, what I did for my turns was modify the move forward animations (by turning the heads/rotating the bodies a little) and they turned out fine. It was easy to do by just creating an extra animation layer, making the modifications, and then collapsing the layer.

You can edit an animation by shifting it in time and/or changing its duration, to allow for optimal blend.

Aaah, thank you all! this is giving me some food for thought.

Though, if anyone could answer this for me so as to confirm my suspicions*: when using a blend-tree, the animations are all essentially matched up as long as they are of the same duration? So, when it blends over from a side-step to the walking-forward animation, it’d do what it can to ensure that if it goes from frame 13 on the side step, it’ll try and keep to the same respective frame on the walking forward animation.

if so, this and the suggestions here should get me well on my way to cracking this.

Thank you!

*The reason this is merely a suspicion is that the blend-tree animations don’t seem to show the same progress bar that you’d see in other animation clips… so, i don’t know for certain if this is the case but i do suspect it is… so, confirmation would be appreciated so that i know for certain.

Just as an update to address Jaimi’s concerns, I’ve been able to use this to blend bipedal walking with side-stepping… and to be fair i’ve also (with the help here) been able to track down why it wasn’t behaving properly.

So, this is gonna be a bit long so bear with me please.

so… the blending system does seem to keep the animation cycles in sync with one another… this is a guess on my part but it seems that it will keep them in sync (though i don’t know how that would work with animation segments that are of differing lengths.) With that in mind and with some digging into the tips that were given to me by Sunny Sunshine i’ve been able to figure out that the reason why the animation wasn’t blending properly on all rotations was that the animations themselves weren’t in sync. By this i mean in one segment one of the legs would be starting out in the drastic movement. so, say the forwards animation had the left foot starting out and the walking sideways was with the right foot starting out, that wouldn’t allow the animations to be in sync because the system isn’t smart enough to know the difference on it’s own (i guess the phrase GIGO fills this… garbage in, garbage out… basically meaning that a computer only knows what it’s programmed to know and in this case it doesn’t have the capacity to realize this itself.)

So, i went through and changed the animation data… i only animated one leg (i don’t want to invest too much time for troubleshooting only) so that the one leg was animated and it was always doing it’s extreme animation… by this i mean the motion of it going up, over and down then sliding at the later half. (i don’t know if this makes much sense but at least i’m trying.)

So, with all those animation clips in sync i’ve managed to address this and yes, it will blend a side-step with a walking forwards and backwards.

When i get this system a bit more refined and the animations a bit more appealing, i’m going to see about putting together a video that i think will do a much better job of showing what’s going on than what text would allow.

so, Thank you very much to all that participated in this thread… your suggestions have really helped me figure this out and for that i am grateful!

You are right Redz0ne, in a blend tree all the clip should be synchronized to give better result.

By example for a locomotion blend tree, at 0% all clips should all have the same foot touching the floor, at 50% the other one and at 100% the same one than at 0%. As you see i’m speaking in term of % because once your clips are inside a blend tree they are all played with a normalize time because they must all stay in sync to blend correctly. So if you have different clips length some clips could be played faster or slower than the original speed.