Animation Intensity

Is there a way to control the “intensity” of an animation via script? Basically I have facial animations that I’ve created for characters and I want a way to control how strongly those emotions show. Like “full angry” vs “half angry” and being able to just control that via the code. I think it would be doable if I could control the intensity of the animation curves directly via script at runtime but I haven’t been able to figure out a good way of doing that. Any pointers?

animation[ “angry” ].weight = x;

To expand, set an idle on layer 0: animation["idle"].layer=0; and Play it in Start. Put nothing else on layer 0. The weight is unimportant. If you have to, just use frames 1-2 of some other animation where nothing is going on.

Then set the smile, frown, etc… to layer 1 (or anything more than zero.) Leave the blendMode on Blend. Setting the weight of Frown to 0.5 (for example) will now be able to pass on the remaining 50% to Idle.

Play might give a little “snap” and CrossFade will try to go to weight=1. So, could use animation.Blend("frown",0.5f, 0.3f); to have it fade in to 50% weight.

Oddly enough what ended up working perfectly here was just to call the enable command on the additive animations and they played right when that was called (without any “Play” call on the animation clip) and they used the assigned weight properly.