EMERYVILLE, Calif. — It takes a fearless sort of man to wear a skirt to the office — even when the office is a den of art school grads, the boss is an avuncular guy with a Hawaiian shirt fetish, and the skirt is a stylish plaid number designed for charging through the Scottish Highlands.

Mark Andrews, originator of “kilt Fridays” at Pixar Animation Studios here in Northern California, has the requisite nerve.

So when Pixar Chief Creative Officer John Lasseter announced in late 2010 that “creative differences” had arisen on the studio’s movie “Brave” — which centers on a rebellious teenage princess in ancient Scotland — and that director Brenda Chapman was being replaced, he looked to Andrews.

In some ways, it was a natural choice — not only is Andrews part Scottish, but a certain steeliness would be needed to bring “Brave” to completion on time for its planned release date just 18 months away. Still, in others, it was a bit of a risk — after all, “Brave” represented a number of firsts for Pixar: its first fairy tale, its first re-creation of a historical era and its first female protagonist.

And Andrews — a shaggy-haired artist who stocks his office with swords, books on Vikings and figurines from the band Rush — is known around the Pixar campus as “Mandrews,” which is both the prefix on his email address and a convenient shorthand for his hyper-masculine interests. Plus, he had never directed a feature-length film.

In an interview in May at Skywalker Ranch in Marin County after a sound mix screening of “Brave,” Andrews said he felt no anxiety about taking over the movie midstream, despite its emphatically feminine subject matter.

“Story’s story,” said Andrews, 43. “That’s like saying, ‘Kathryn Bigelow, did you feel any trepidation in stepping into a movie that’s guy-dominated in ‘Hurt Locker?’ … Were people worried that she couldn’t get into the head of a guy who’s nuts? There’s no gender thing that lets you do it better than somebody else. It’s about, ‘Is the character relatable?’ That was one of the big questions when I came on. They were all, ‘OK, he’s the action guy. This is a movie about women and getting touchy-feely. Can Andrews get touchy-feely?’“

In “Brave,” which opened in theaters Friday, flame-haired and feisty Merida (voiced by Scottish actress Kelly Macdonald) prefers shooting arrows and riding her horse to the fussy obligations of princessdom advocated by her mother, Queen Elinor (Emma Thompson). Aided by a bit of magic, Merida indulges in some teenage defiance and sparks a crisis in her kingdom, one that not even her father, the imposing King Fergus (Billy Connolly) or her mischievous triplet brothers can fix.

Chapman launched the production in 2006, basing the story on her relationship with her own daughter. Even by the meandering standards of Pixar, where a four-year production with stops and starts and regular rewrites is the norm, “Brave” traveled a long and winding road, with changed release dates, a different title (“The Bear and the Bow”) and at one point Reese Witherspoon set to voice Merida. But the director swap was especially painful, and attracted attention in part because Chapman was the first woman named to helm a Pixar film.

“You never want to do it,” Lasseter said in an interview at the Skywalker Ranch screening. “It’s always hard.” (Chapman, who still works at Pixar and retains story credit, attended the premiere Monday in Hollywood but has said nothing publicly about the director change and did not respond to requests for comment on this article.)

Lasseter said he selected Andrews to take over “Brave” because of the director’s “sense of action and heart.”

In the early days of work on “Brave,” when Chapman was at the helm, Andrews served as an unofficial “all things Scottish” consultant on the production — he got married in a kilt and planned his honeymoon around the craggy island from the back of a cab in Edinburgh. The medieval look of the film suited his own swords-and-castles aesthetic, and he accompanied Chapman and producer Katherine Sarafian on an early research trip for the film.

As “Brave” developed, Andrews was pursuing his own projects, including an unannounced Pixar feature with some sci-fi elements and a live-action writing and second unit directing gig for fellow Pixar director Andrew Stanton on “John Carter,” the high-profile Disney fantasy adaptation that ultimately fizzled at the box office in March.

At the same time, “Brave” was marching toward release with its pivotal mother-daughter relationship still in flux.

“We started out and Merida was too bratty, then she was too nice,” Sarafian said. “And mom, similarly, you needed to feel like she wasn’t so strict and stern that she wasn’t any fun as a mother, but if you completely feel sorry for her the whole time then Merida is a villain.”

Not for the first time at Pixar, Lasseter and the studio’s creative executive team removed a director from a project.

“I can’t speak to the specific creative differences, but it’s happened before in Pixar history where the creative plan of a director is wonderful and amazing and gets us to a point and then differences come up that make it such that we can’t continue,” Sarafian said.

Early reviews for “Brave” have been largely positive, if a notch below the effusive praise usually heaped on Pixar films — while lauding the rich visuals, some critics have found the story too earnest and safe. Still, pre-release surveys indicate the film is expected to take in about $65 million domestically in its first weekend of release.

On Monday, Andrews confidently wore his kilt to the premiere in Hollywood, and Chapman attended in a bright blue dress. In the final credits, the two share directing credit, along with Steve Purcell.

“We’re not curing cancer or sending someone to outer space,” Sarafian said. “We’re making movies. But it’s a creative pursuit, in a pressure cooker, over a long period of time. With every decision we’re asking ourselves, ‘What are we made of?’ “