Dax Shepard got 'CHIPS' greenlit because of Michael Peña's casting - but he hadn't even met the actor or asked him to the be in the film.

Dax Shepard

Dax Shepard

The 39-year-old writer-and-director - who also plays Officer Jon Baker in the movie - admitted he had made a "ballsy, dangerous commitment" with his promises to Warner Bros., but was totally convinced the 41-year-old actor was the right man to play Officer Frank 'Ponch' Poncherello.

Asked if he always knew he wanted Michael to be in the film, he said: "Yeah, before I knew that I was going to be in it. When I went to the studio, I was there to get a writing job and hopefully a directing job. I had been on TV the last six years -- I didn't think at all that they were going to let me be a lead in a movie.

"But I knew it had to be Peña to play Ponch, because I was trying to take something that is very time-stamped in 1977 and by today's standard has some camp and cheese to it, and I just knew I needed a really great actor who had some actual gravitas to help me get there. And by my estimation, Peña was the single option for that.

"And the studio obviously loved that idea -- every studio loves Peña.

"So I left the meeting, I sold this thing, and I realised, oh my god, I just sold a movie starring Michael Peña, but he doesn't know that, and I've never met him.

"So the next thing was like, 'Oh s**t, I've got to go woo Michael Peña and get him to sign on to what is a kind of ballsy, dangerous commitment.' "

After Michael agreed to be in the movie, and the studio also suggested Dax cast himself, the filmmaker was relieved to find they had great chemistry on screen.

He told Vulture: "That's pure luck. Because I've done movies with people I love, and we have no chemistry. And then for whatever weird reason, he and I were just a really good odd couple right out of the gate.

"I started seeing dailies come in and thought, Oh thank god, we have some kind of chemistry going on. We have some spark."