Keira Knightley is to be the star of the opening night of the Edinburgh International Film Festival, it was announced last night.

Her leading role was revealed as her new film The Edge of Love - a Dylan Thomas biopic written by her mother, Sharman Macdonald - was chosen to open this year's event.

The Academy Award nominee, as well as co stars Sienna Miller and Matthew Rhys, will walk the red carpet for the opening gala of this year's festival, the first EIFF to be staged in June.

As things stand, the showing of the film would be a world premiere - it is as yet unknown whether it is to be shown at the Cannes film festival, which opens on May 14.

The Edge of Love, directed by John Maybury and also starring Cillian Murphy, follows the story of the distinguished Welsh poet Thomas when he is caught in a love triangle between Vera Phillips, played by Knightley, a childhood sweetheart of the poet, and his wife Caitlin, portrayed by Miller.

Glasgow-born Macdonald, whose plays include When I Was A Girl I Used To Scream And Shout, focuses on a particularly traumatic incident in the life of the poet - when his tangled relationships led to a man attacking his home with a machine-gun and threatening him with a grenade.

Before she became a successful writer, Ms Macdonald was also an actress - she spent 12 years in new plays and had small parts in the 1970s women's prison drama Within These Walls and the private detective drama Shoestring as well as acting for the 7:84 theatre company.

Hannah McGill, the director of the EIFF, said: "I could not be happier to be opening this most auspicious festival with this utterly seductive and fascinating film, which stars some of the most charismatic young performers in the business, and affirms John Maybury as one of our most important directors.

"It's a film that I adore, and opening with it is the perfect expression of our commitment to intelligent, impassioned, exciting new film making."

Maybury said: "I am thrilled and honoured to have the film at the Edinburgh Film Festival.

"I have a deep affection for the festival since they were so good to award Love Is the Devil, the Michael Powell Award and Derek Jacobi and Daniel Craig, joint best actor awards 10 years ago".

The showing of the movie on June 18 will be two days before its London premiere - its nationwide release is on June 27.

Yesterday it was also announced that an adventure set in Scotland is to be one of the new films created by the multi-award winning animation giants Pixar.

The Bear and the Bow will be made in digital 3-D, and will be directed by Brenda Chapman, who also directed The Prince of Egypt and The Lion King.

It will feature, according to the company, "humour, fantasy and excitement in a rich Highland tale".

The Bear and the Bow is an original story, described as "an action-adventure about a royal family in rugged and mythic Scotland".

It will be released for Christmas 2011 and will star the voices of Reese Witherspoon, Billy Connolly and Emma Thompson.

"We're excited to be pushing the boundaries of 3-D and computer technology to tell our stories in the best possible way," said John Lasseter, chief creative officer for Walt Disney and Pixar Animation Studios.

Digital 3-D still requires movie goers to wear the distinctive coloured glasses.