FOR YEARS, most of Pixar’s films had male leading characters. A Jesse or an Elastigirl might get her moments in the sun, but these universes generally revolved around the dudes, be they a toy or an ant, a race car or a rat.

But a funny thing happened on the way to this weekend’s “Cars 3″: More Pixar creatives became inspired by their daughters. Brenda Chapman broke barriers by directing Pixar’s “Brave” as a cinematic love letter to her daughter, she told Comic Riffs at the time. Pete Docter said his “Inside Out” was inspired by observing his tween girl. And “Finding Dory” blended an obvious sequel choice — given the fan affection for Ellen DeGeneres’s blue tang character — with the aim to move toward more equal representation.

Now, with “Cars 3″ (opening Friday), fans may come for ol’ Lightning McQueen, but they will leave surely appreciating new car Cruz Ramirez (voiced by comedian Cristela Alonzo) as a breakout character.

In the case of the new film’s director, Brian Fee, the parenting of daughters Lucia, 11, and Eleanor, 8, has enlarged his perspective. “A lot of them is in Cruz,” he says.

Through much of his career, Fee says, he wrote from the male perspective because, as the old literary adage goes, “Write what you know.” And as a child of the ’80s while growing up in northern Kentucky, he notes, the movies he gravitated toward — the “Indiana Jones” and “Back to the Future” and original trilogy “Star Wars” films — had male leads.

“Now that I have two daughters, I see the world through their eyes,” the director says. “I see how little they have [culturally], and I see what they’re up against. I see how they hold themselves back.

“It’s still, ‘Write what you know.’ It’s just that now, I know this other side.”

In the film, Cruz enters Lightning McQueen’s life as a seemingly confident motivational trainer. But gradually, we see that she has forfeited her dream of becoming a race car because she was told it would never happen — that she couldn’t compete with the big boys.

“I have empathy for my daughters,” says Fee, noting that he recently suggested to them that they might take up an instrument. The reply: “Daddy, guitars are for boys.” One daughter, he says, “had already drawn that conclusion and line for herself — that this was no longer an option. … That breaks my heart.”

Such moments, though, inspired the filmmakers to turn Cruz — who was originally conceived as a male character — into a female car. Many of the existing characters were male, he notes, as they looked around to make the gender representation more even.

“Cars 3″ is also a tale about mentorship — Fee’s parenting of daughters led to parallels in how Lightning McQueen (voiced by Owen Wilson) guides Cruz to strengthen her self-belief to overcome prejudice.

“That found a way onto the screen in some ways,” Fee says. “I can’t wait for that day when there are no barriers, but until then, I want to help them break those barriers.”

Last week at the premiere for “Cars 3,” a red carpet reporter asked the director’s younger daughter what she thought of the film. Eleanor summed it succinctly: “It was funny but also inspiring.”

“I didn’t tell her to say that,” Fee says with a laugh. “They don’t really know how much they inspired a lot of the Cruz character.”