Stress while pregnant

Can the stress and sadness affect the baby of a family pet loss?

My dog isn’t doing too well and I’ve noticed my moods changing. Does the crying and sadness affect my poor baby? 25 weeks pregnant.