New Zealand prime minister John Key opted not to attend the Queen's official opening of the Commonwealth leaders summit in Perth, preferring instead to visit The Hobbit movie set.

Mr Key, who will contest a general election on November 26, chose not to attend the Commonwealth Heads of Government Meeting (CHOGM) in Western Australia as his campaign for a second term intensifies.

On the same day the Queen opened the 54-nation bloc's meeting, Mr Key was visiting the set of Oscar-winning director Peter Jackson's latest Tolkien epic The Hobbit, in Matamata on New Zealand's North Island.

Mr Key, who sent foreign minister Murray McCully to represent him in Perth, amended his country's labour laws last year after Jackson and Hollywood studio chiefs threatened to move the film's production offshore over a dispute with unions.

His centre-right National Party enjoys a huge 27-point lead over the opposition Labour Party, with his personal rating as preferred prime minister on 59 per cent, compared with Labour leader Phil Goff's 8 per cent.

Campaigning for the election was put on hold during the Rugby World Cup, which ended with a New Zealand victory on Sunday, and Mr Key will be keen to press home his advantage among voters rather than strut the world stage.

Jackson denied Mr Key's visit to the movie set amounted to a political endorsement, Fairfax Media reported, with the director saying he had worked with Labour governments in the past.

The Hobbit is a two-part prequel to The Lord of the Rings trilogy, with the first instalment set to premier in Wellington in November next year.

AFP