Making visemes override facial gestures

I’m trying to set up facial gestures on my avatar, and everything works great, except that if I have a gesture that, say, makes the mouth grin, then all of the visemes get stacked on top of that, causing some really wonky facial animation to take place. Is there a way to make it so that a gesture animation stops while viseme animations are running?

For example, I have a blendshape called mouth-grin which one of my gesture animations sets. If I start to talk while that blendshape is active, it looks kinda goofy, and I’d like that animation to not run while I’m speaking.

I tried setting my animator transitions to require that the Viseme parameter is 0, but that made no difference.

I figured it out - I needed to also add an explicit transition back to the idle state when Viseme became non-zero while the gesture was active.

And for reference for anyone else running into this issue, here’s my FX animator’s state graph:

and where to add the constraints on the transitions both into and out of the various states (in this case the “hands open” gesture):

In my graph I just used the horizontal position of the gesture states as a rough indicator of which ones need the viseme constraint as well.