Your daughter has certainly been hearing you speak of your pregnancy, your feeling tired or uncomfortable, and watched you preparing a space for the baby. She may be worried about what her new standing will be once the baby arrives. You probably have less energy to give her because of your pregnancy. The baby isn't here yet, but changes are. And yes, that could have everything to do with her regression.
Pooping uses a different set of muscles than peeing. It is somewhat more under our conscious control, while still depending on the automatic peristaltic action of the intestinal muscles to provide the push. But, just like anxiety or excitement can disrupt the automatic breathing action of our diaphragm, so can anxiety disrupt peristalsis. In extreme fear those muscles can just let go and people soil themselves. In ongoing emotional strain, the muscles can tense up, resulting in slowing of the natural action. This can become chronic enough to cause constipation, which in turn can morph into a more serious condition called encopresis, in which a built-up blockage causes stretching and numbing in the colon, and the child may not even be aware she has pooped.
Your daughter could be in much need of reassurance right now, and even more after the baby arrives. She may not feel "ready" for the changes that she's experiencing, and could be worried, distracted, and lonely.
These emotions can definitely mess with her willingness, or even ability, to be potty trained right now. I can certainly understand that you feel frustrated about this, but I hope you are not expressing that as anger toward your daughter, which will only compound her worries and make the situation worse. Punishment for her dismay will confirm in her mind that you don't love her as much anymore, and if she begins to feel unworthy of your love, she will have ongoing behavioral problems for years.
Give her as much special mommy time as you are able, let her know that she will always be just as precious to you as when she was born, and watch out for signs of constipation so you can deal with it before it becomes worse.
Wishing you the best with your growing family.