Mia,
What an idiot. I hope the judge dismisses him quickly.
Now, on to the children being upset. I think a child can be helped through this and rebound pretty well when one parent is functional. If your daughter is upset, the optimal thing is not to get upset along with her. If you can contain her feelings and help her express them without reacting too much, she will be relieved of some of the burden. However it puts a burden on you, so I hope you have your own therapist. I'm sorry, I can't remember how old she is. I've found that a child is helped almost immediately by an adult not overreacting and not getting upset, but empathizing with them and helping them come up with ways to deal with the problem. Maybe you're already doing this. For instance, when they're at Dad's and he is badmouthing you, they could say, "dad, no put downs," or if that isn't safe, they can pre-arrange to leave the room and play elsewhere. These things make a child feel less helpless. Just off the top of my head.
bunny