Added object mode set at head of export to prevent script failure if

export is not executed in object mode.