There will be plenty of happy faces when the new musical Sunshine On Leith hits cinema screens this weekend.

One person who will not be smiling, however, is the gentleman who landed a part - as an extra - of a man staggering out of a pub following a knees-up.

His scenes have been cut and the director, Dexter Fletcher, stepped in instead.

"It's not there for a 'Hey, look at me!' moment," says 47-year-old Fletcher. "It's there because the guy we got didn't do a great job, so I was encouraged by our cameraman and cast to do it. If people know it's me and smile, that's great, but I'm slightly dubious about it."

His is not the only cameo in the feel-good film, a good chunk of which was filmed in Glasgow. Identical Scottish twins Craig and Charlie Reid, better known as The Proclaimers, also crop up.

"They were on set twice and I just said: 'Guys, will you walk out of the pub here?'" says Fletcher. "It gives us a great light-hearted moment, and you know you're allowed to laugh in this film."

The duo's songs feature throughout the narrative and are, to all intents and purposes, the reason the film came about.

Sunshine On Leith started life as a stage production. Well, more accurately, the title first belonged to a Proclaimers album from 1988. Then, in 2005, screenwriter Stephen Greenhorn was looking for a Scottish musical he could develop with his friend James Brining, artistic director of the Dundee Repertory Theatre.

One night, while listening to The Proclaimers, he drunkenly scribbled 'Proclaimers musical' on the back of an envelope and went to bed. He woke up with no recollection of his inspired idea - until he saw the scrawl.

After securing permission from the Reid brothers, Greenhorn and Brining spent two years developing the show before its stage premiere in 2007.

"A film producer had seen the show and thought it would be a great idea for a film," says Fletcher, explaining the final phase of Sunshine On Leith's evolution.

"I got involved a little bit after that. It's a companion piece, rather than an adaptation.

"Musicals were my first great love as a kid. The first film I remember sitting down to watch was Singing In The Rain, and of course, I was in Bugsy Malone."

Indeed, a schoolboy Fletcher made his film acting debut as Baby Face in the 1976 hit. When it came to helming Sunshine On Leith, like Bugsy's director Alan Parker he was keen to ensure the story would work dramatically with or without songs.

In the same way that Mamma Mia! bears no resemblance to the lives of the four members of Abba, Sunshine On Leith does not focus on any Scottish twin singers.

Instead, the story explores the Henshaw family who live in the Leith district of Edinburgh, and their relationships with assorted friends and partners.

At the head of the family are husband and wife Jean and Rab, played by Jane Horrocks and Peter Mullan, while relative newcomers Freya Mavor and George Mackay play their kids, and Kevin Guthrie and Fletcher's former Misfits co-star Antonia Thomas are the siblings' respective boyfriend and girlfriend.

Horrocks and Mullan were "the dream team", adds Fletcher.

"Jane, we know, is not only a great actress but has a fantastic voice, and people love her. That is very important for the character, that people empathise with her and see how strong she is during tough times," he says, referring to a certain revelation that comes to light during Jean and Rab's 25th wedding anniversary party.

"With Peter, we have never seen him get the chance to play the part of a father who is at the heart of a family."

Unlike Horrocks, who's proven her musical prowess in Cabaret and Little Voice, Mullan has never sung on screen before.

"He said to me: 'I'm no Pavarotti', but that wasn't what was required. It's about him loving the song and singing the way he does," Fletcher says. "Besides, he's an old Proclaimers fan, so I think he was thrilled with the opportunity."

Although based in Leith, for financial reasons the majority of scenes were shot in Glasgow which, according to Fletcher, is "very vibrant and has a youthful buzz about it".

He adds: "It's had a bad rep for some reason, but I think it's a cool, lovely place and the people are charming."

But the big closing number, which sees hundreds of people come together to belt out The Proclaimers' famous hit I'm Gonna Be (500 Miles), was shot in Edinburgh.

"It's a song people know instantly, and we played it loud and proud and the country pretty much joined in," says the director.

He still can't quite believe they managed to shoot a sunny Scotland in the middle of winter.

"We would've taken whatever weather we got but it just so happened the week we were shooting outside, it shone. It was one of those happy accidents."

n Sunshine On Leith is released on Friday