Rainn Wilson in for 'Transformers 2'

Actor to play a small role in the sequel

If you've ever wondered just how Dwight Schrute would handle himself in a brawl with a gigantic robot, well ... it looks like you're going to get an answer.

Rainn Wilson, who plays the intense (and intensely funny) Schrute on NBC's "The Office," has revealed to MTV that he has been cast in DreamWorks' "Transformers 2." The sequel to last year's megahit about a race of automotive automatons smashing it out on Earth reteams director Michael Bay with returning stars Shia LaBeouf, Megan Fox, Josh Duhamel, Tyrese Gibson and John Turturro.

The story was conceived by Alex Kurtzman and Roberto Orci, who wrote last year's "Transformers," as well as Ehren Kruger, who wrote the screenplay. Filming began in Los Angeles in recent weeks and is moving to Pennsylvania and then overseas.

Although a small part, Wilson's casting -- his first in a big-budget studio franchise -- could be a shrewd play for a comedy crowd that might not otherwise patronize a bombastic Bay extravaganza. He will play a college professor to LaBeouf's new undergrad. Discussions with Jonah Hill to take another small role did not pan out.

The writer-actor, who also had a small role in "Juno," stars in "The Rocker," opening Aug. 1, and is working on the screenplay for "Bonzai Shadowhands" with Jason Reitman for Reitman's Hard C. Wilson is repped by 3 Arts and WMA.