Scottish writer-director-actor Peter Capaldi (“In the Loop”) has landed Ewan McGregor and is in talks with Kate Hudson to star in his mistaken identity comedy “Born To Be King.” The film will shoot at Pinewood Studios in January. Indomina’s Stephanie Denton is handling foreign sales at the American Film Market.

McGregor will play dual roles as an extra who resembles a major movie star during the shooting of a period film. Hudson would play a starlet who has issues with the star but likes the extra.

Capaldi, who won an Oscar for his short film “Franz Kafka’s It’s A Wonderful Life,” promises a film that is “artful and magical” and “entertaining.”

Los Angeles producer Dan Lupovitz, who has been nurturing the project for two years, calls Capaldi’s orginal screenplay a “full out bells and whistles comedy.” McGregor and Capaldi have been compatriots and pals for years, and Hudson was Capaldi’s first choice, says Lupovitz, because of her superb comic skills.

Lupovitz will produce with Alexandra Stone. Ron Fogelman and William Parente will executive produce. Elaine Collins will co-produce.

Hudson stars in Mira Nair’s upcoming “The Reluctant Fundamentalist,” opposite Liev Shreiber and Kiefer Sutherland, and is guest-starring in six episodes of “Glee.”

McGregor stars in fall Toronto entry “The Impossible,” opposite Naomi Watts and is currently in production on John Wells’ adaptation of “August: Osage County” opposite Meryl Streep and Julia Roberts. In 2013, McGregor will star in Warner Bros. “Jack the Giant Killer,” directed by Bryan Singer.

Capaldi has starred in four series of the cult political satire, “The Thick of It” and directed comedy series “Getting On” and, most recently, BAFTA-nominated “The Cricklewood Greats.”