With his second feature film for Marvel Studios a week and a half away from its release date, Joss Whedon has become one of the driving voices behind the company's blockbuster slate of movies. As the writer and director behind 2012's "Marvel's the Avengers" and 2015's "Avengers: Age of Ultron," Whedon has worked with Marvel Studios to create the biggest of big movies, dealing with all sorts of epic obstacles and hurdles along the way.

In a new interview with Buzzfeed, Whedon discusses those very obstacles and hurdles and his reaction to the departure of filmmaker Edgar Wright from the Marvel fold. The writer/director guided "Ant-Man" from the early stages of development, which predate the creation of the shared Marvel Cinematic Universe in 2008, all the way up to last May when Wright left the project citing creative differences. Whedon, who had read Wright's script, admitted he was a bit surprised when he learned of the shakeup.

"I thought the script was not only the best script that Marvel had ever had, but the most Marvel script I'd read," said Whedon. "I had no interest in Ant-Man. [Then] I read the script, and was like, Of course! This is so good! It reminded me of the books when I read them. Irreverent and funny and could make what was small large, and vice versa. I don't know where things went wrong. But I was very sad. Because I thought, This is a no-brainer. This is Marvel getting it exactly right. Whatever dissonance that came, whatever it was, I don't understand why it was bigger than a marriage that seemed so right. But I'm not going to say it was definitely all Marvel, or Edgar's gone mad! I felt like they would complement each other by the ways that they were different. And, uh, somethin' happened."

"Ant-Man" gained a new director, Peyton Reed, soon after Wright's departure. Adam McKay and "Ant-Man" star Paul Rudd also took a pass at Wright and co-writer Joe Cornish's screenplay. Their changes earned them a screenplay credit while Wright and Cornish maintained a story credit.

"Ant-Man" opens in theaters on July 17.