Jennifer Garner saved ex-husband Ben Affleck's new movie 'The Way Back,' director says

Ben Affleck’s new movie, The Way Back, almost didn’t happen, the way director Gavin O’Connor tells it.

“So what happened was, just as we started prepping the movie, Ben fell off the wagon,” O’Connor told 34th Street, a student magazine at the University of Pennsylvania. “So he ended up going to rehab, and I didn’t know if the movie was over. The studio certainly thought the movie was over. His ex-wife Jennifer Garner called me up, and told me that when he went to rehab, he took a basketball with him. She said, ‘Gavin, he’s asking you, please don’t pull the plug on the movie, he really wants to do this.”

Garner and Affleck married in June 2005 and announced their split exactly 10 years later. They’ve remained on good terms, though, and they’re regularly seen together co-parenting their three children: 14-year-old Violet; 11-year-old Seraphina; and Samuel, 8.

The actor/director of Argo has struggled with alcoholism for most of his life and has gone to rehab three times in all — in 2001, 2017 and 2018. He publicly celebrated a year of sobriety in 2019, just before TMZ captured video of him stumbling after a Halloween party.

“Relapse is embarrassing, obviously,” Affleck told the New York Times last month while promoting the movie. “I wish it didn’t happen. I really wish it wasn’t on the internet for my kids to see. Jen and I did our best to address it and be honest.”

The basketball Affleck brought with him for his third rehab stint was key, because O’Connor’s movie is set in the world of the sport. Affleck plays a former high school basketball star whose struggle with addiction causes him to lose his family and end up coaching his former team.

“So, he had about a week of detoxing, because he really went off the deep end, and after a week, I was able to go see him,” O’Connor said of Affleck, who was also his leading man for 2016’s The Accountant. “We spent half a day together and figured out a way to do this that will work for him, because most importantly he needed to recover and needed to get his sobriety on track. That overtook everything. And then he got out the day before we started shooting. So we had a very raw, vulnerable guy showing up for our first day of shooting.”

Affleck found portraying a character with a similar issue “very therapeutic,” he told the Times.

In the same interview, he called his divorce from Garner “the biggest regret of my life.”

Read more from Yahoo Entertainment:

Want daily pop culture news delivered to your inbox? Sign up here for Yahoo Entertainment & Lifestyle's newsletter.