Gotham costars Morena Baccarin and Ben McKenzie, who are expecting a child together, plan to get married – as soon as Baccarin can secure a divorce from her husband Austin Chick.

Morena Baccarin, Ben McKenzie to Wed?

According to Baccarin’s legal declaration, filed on Sept. 11, the actress is already looking to remarry.

“Today, I am in a new committed relationship,” Baccarin wrote in court documents obtained by People magazine. “I am planning to re-marry. Also, I am three-and-a-half months pregnant.”

Apparently, Chick, who had filed for divorce back in June citing “irreconcilable differences,” he was blindsided upon learning of Baccarin’s affair with McKenzie earlier in the year.

Austin was totally shocked when he found out about the affair,” a source told Entertainment Tonight.  “Totally blindsided. When Morena left him for Ben, Austin was devastated — completely shocked.”

Baccarin claims in court documents that separation talk first started happening around March – around the time that McKenzie allegedly started visiting the Homeland actress on the set of Deadpool in Vancouver, Canada. During one of McKenzie’s visits, a fan captured a picture of the two together.

“Austin confronted Morena about the photo,” a source told ET. “She didn’t deny it and said she no longer wanted to work on [their] marriage.”

Making matters more complicated for the estranged Baccarin and Chick is their custody battle over 23-month old son, Julius. A judge ruled last week that Baccarin will have primary custody of Julius in New York while she shoots Gotham in the city. As part of the arrangement, Chick is to have a New York apartment in which to spend time with his son during his visits.