Animation with time as blend factor

I am trying to blend 2 poses together, before everyone starts yelling blendtree, It won’t work in this case. I understand why but it is a bit complicated to explain here. Here is the result of that

(Notice the jitter and all the unwanted foot movement)

So what I have done is made an animation for the entire range of the blend. Then each frame I call Play(blend_As_normalized_Time) on the animation. Which isn’t a great solution. I need a 2D blend so I end up with a few additive layers to do this, but hopefully I can get it working. Only problem now is that the animation jitters for some reason.

I am calling Play in Update. Is there a better place to do this? Or even a different/better way to do this?

What would really be great is to have an option on the blend tree that lets me select the frame of the animation based on a blend. So instead of putting 2 animations on each extent on the blend. I could put one animation across the range and the blend would just select the frame I need. Basically you are explicitly defining the blend of the pose at every position. Then you could do interesting things with the blend, for instance in this case the guy could change his grip in the process of turning, etc.

Anyways any advice here is appreciated.

The other thing that would be cool is if Unity let you define one frame clips, even if internally it just duplicated the frame. It would make setting up poses so much easier.

Hi DDNA

I don’t know if you did try it but in this case I would create some additive animation clip with a length of 1 frame(yes this is supported): Aim up, Aim down, Aim right, Aim left and for each of those clip set a Aim straight as the additive reference pose.

Take a look at this package it should work in 5.3,a controller with two layer, first one implement the full body movement for idle, second layer is set as additive with an Upper body mask, and on the additive layer you have a 2d blend tree with the 4 one frame clip.

2755485–198803–aimpackage.unitypackage (1.48 MB)

The problem here is that the 2 poses don’t work with a linear blend. What you are describing is exactly how it is setup in the first video.

I did come up with a way of solving this but it wasn’t pretty. Basically I made 24 1 frame clips and put them into a huge blend tree.

So basically the Blend tree is simulating this non-linear interpolation. Setting this up was a mess, this is where it would be nice if I could just put an animation over the span of the blend. i.e. the blend factor was just picking a place in the animation.

Another question that I had was which Blend mode is appropriate for a look like this? I am still struggling with this. Let’s ignore the nonlinear blend problem above for a moment, and say I just had 4, 1 frame poses like you describe and set them up in a 2D blendtree. When I have “Look up” and “Look Left” at their fullest extent, I don’t want an animation that is a 50%-50% blend. Because the extents would only be 1/2 of where it needs to be. For example only 50% to the left and 50% up versus all the way to the left and all the way up.

Right now the way I had to set this up was to have 2 additive layers, one that handled blending left to right and one that handles Up to Down. So when each are at their fullest extent I am getting, BaseLayer+Full Left+Full UP, vs BaseLayer+50% Left+50% Up.

Yes that a way to solve the blending issue by separating both axis so you get the full animation range for both axis, clever!

One of the things that occurred to me here is if this will cause a performance problem. There is likely going to a lot of these in the scene. For example is Unity running 25 animations now all the time for this simple blend? Is that going to matter?

You are using a 1d blend tree so in this case you can blend at most two clip at the same time, Unity will play only clip that have a weight > 0.

A 2d blend tree is the worst case scenario, depending on the configuration of the blend tree you can end up with some weight on all the clip. So in this case we need to play all the clip to get the final blended pose