The character of Gandalf the wizard in The Hobbit is someone who can be generous and good natured, but who, in times of trouble, you don't want to mess with.

The same could be said for Sir Ian McKellen who reprises the part again for Sir Peter Jackson's new film trilogy.

''I won't sign the what-is-now-standard in the film contract, the clause which says you will not say anything negative about the film you're making for the rest of your life. Ridiculous clause,'' he says.

While out of makeup and costume and seated in a cold prefab on the set of The Hobbit, Sir Ian still has the gravitas of Gandalf as he extols his views on how much freedom an actor should have to talk about the projects he or she works on.

He goes on to explain: ''Does that mean to say, on my dying - when I'm dying - I can't say I didn't like what I did in that film? It's nonsense. But I'm totally supportive of these films, I think they're absolutely marvellous. I wouldn't do anything to harm them, but a little bit of honesty doesn't come amiss.''

Sir Ian, 73, was a bit of a pioneer when it came to using the internet for his involvement in The Lord of the Rings. Back in 2000 when blogs were in their infancy, he was the only Lord of the Rings actor to write about the film online and he revealed a few details that were unavailable elsewhere. He even posted a few photographs.

''In fact, I think I invented blogging, 'cause I kept an online diary,'' he says.

''I think that's what I called it. I didn't think up the word 'blog', but I was sending regular reports from the set, around the world, with the huge support and approval of Peter Jackson, who now does his own blogging. And very sophisticated it is, too, he's got film crews and everything.''

Early in The Hobbit Sir Ian posted and tweeted a photograph of himself dressed as Gandalf and wearing 3-D glasses. It was one of the first peeks of behind-the-scenes on the film.

''I remember that photograph, and I showed it to Peter, and I said, 'Do you think we could put this up?' 'Oh, yes!', he said. 'The fans'll love it!' But on the whole, you've got to ask permission.''

Throughout the filming of The Lord of the Rings, Sir Ian spent months at a time in New Zealand. Of all the actors in The Hobbit who are reprising their roles from the trilogy, he has the biggest part.

''A lot of it's the same and some things are a bit different. Although there are lot of new actors, the crew - they're very familiar. The director, of course, the producers, the script writers, the lighting cameramen, the operators, the props people, they are all back from 12 years ago. [Even] Emma, who dresses me, is the same. [and] Rick, who does my makeup, is the same. So it's very much like coming back.''

Important for Sir Ian was that the Gandalf of The Hobbit is Gandalf ''the Grey'', rather than the more warrior-like Gandalf ''the White'' of the second and third Rings movies.

''I, like Peter, we both preferred Gandalf the Grey because he's on a much more human level, he is not quite driven as the 'White Commander' who comes in to save the world. So it was comfortable to be back with the Gandalf that we liked.''

Like the books, the tone of Jackson's The Hobbit will also be different to that of The Lord of the Rings, he says.

''[In] In Lord of The Rings they are saving the world, everything is at stake. The hero dies. Frodo literally dies. The Hobbit, no, The Hobbit is an adventure story that's told in the first person by Tolkien. He's in there, he makes comments, he makes jokes about the characters. And that lighter quality is what Peter went for straightaway, and that's very different.''

Sir Ian says that's reflected in the casting of Martin Freeman as Bilbo - Freeman is best known for his comic acting in television series The Office, and the other cast includes Barry Humphries, Billy Connolly and Stephen Fry, who are as well known for their standup comedy and live comic performances as their film acting.

Sir Ian says during the film's development has been forthcoming with Jackson and his co-writers Fran Walsh and Philippa Boyens. For one, he felt that the relationship between Gandalf and Bilbo needed a little history.

He suggested a scene showing the wizard being introduced to a baby Bilbo and his mother Belladonna Took and it was shot. He's not sure if the scene will make the final cut of The Hobbit: An Unexpected Journey, but his suggestion was taken seriously.

''We see Gandalf observing this little boy who's full of beans and full of adventure. And I let him play with [a] toy dragon that I've got.

''And when he's thinking, 'Who should we get? Oh, there's that little boy'. And he goes back to Hobbiton to meet this little boy who's now grown up and is a real stodgy, dull, settled, unadventurous person. And he's so disappointed. 'What happened to you? Come on! You've got to go on an adventure, it'll be good for you. Get back your childish enthusiasm!'''

It's something to which Sir Ian the actor can relate - whether to stay in his comfort zone or take risks. It was one reason he decided to do Gandalf again.

''There are other elements in my life where I probably have got too settled and wish I hadn't. I think the way I cope, or try to avoid becoming too dull, is by having a wide range of friends. And that would include a wide range of ages.

''I've got a lot of quite young friends and I think that for somebody of my age, that's good to be reminded that other people are just setting out, and you can catch their excitement and realise that it can go on all through your life if you want it to.''

THE DETAILS

The Hobbit: An Unexpected Journey has its world premiere in Wellington on November 28 and is released nationwide on December 12.