ABOUT FIVE YEARS AGO, Oscar-winning Pixar filmmaker Pete Docter began working in earnest on a new project. It would be a movie inspired by his own family life, about what happens when a daughter hits adolescence.

Not long before, Docter — who directed such films as “Up” and “Monsters, Inc.” — had also given up hope on the comics page, having grown up as he did on “Peanuts,” and having relished the newspaper funnies until the mid-’90s, when “Calvin and Hobbes” sledded off into the sunset.

[THE ‘RIFFS INTERVIEW: ‘Monsters University’: What’s a guy gotta do to get a directing shot around here?]

“I grew up loving comics, and ‘Calvin and Hobbes’ ‘ Bill Watterson is amazing,” Docter tells The Post’s Comic Riffs. After that, “Basically I had given up on comics because they were in kind of a sad state.”

Years later, though, came a welcome and eye-opening reason to return to the page, he says.

“Somebody told me about ‘Cul de Sac’ and I thought: ‘Ah, okay.’ I didn’t get to it for a number of months. But then I saw it, and I saw IN it somebody who did such quality work,” Docter tells The Post. “Not only the drawing but more important, the writing and the characters. They seemed so real and specific. I was such a big fan.”

Docter, like Watterson and so many other visual-storytelling colleagues, had discovered the genius of Richard Thompson — who tonight at 7 will be celebrated at D.C.’s Politics & Prose, as authors/contributors to the new career-retrospective book “The Art of Richard Thompson” will speak and sign, including The Post’s Gene Weingarten and Post Writers Group cartoonist Nick Galifianakis. (Note: Comic Riffs will moderate.)

[THE ‘RIFFS MAGAZINE PROFILE: Richard Thompson faces life’s cruel twists with artful wit]

So when it came to seek input from outside artists, you can guess who got a call from Docter.

“I starting working on this thing, ‘Inside Out,’ five years ago,” Docter recounts of the film (which is co-directed by Ronaldo del Carmen, with screenplay by Michael Arndt). “I was just starting to develop who the characters were, and Richard leapt to mind. He draws incredibly well and his ideas are awesome. I didn’t know he had daughters at the time, but we were just beginning to get a beat on who the characters were.”

[THE ‘RIFFS INTERVIEW: ‘Toy Story 3’s’ Michael Arndt: How getting the Pixar call is like playing center field for the Yankees]

In Pixar’s forthcoming “Inside Out,” emotions become characters, as we go inside a girl’s mind. (Example: Amy Poehler is Joy, Bill Hader is Fear, Mindy Kaling is Disgust and Lewis Black voices Anger.) Docter knew Thompson could bring insight to the table — an artist whose input inspires Pixar’s artists — so the “Cul de Sac” creator was hired to provide character sketches.

[THE ‘RIFFS INTERVIEW: Bill Hader embraces his inner nerd]

[THE ‘RIFFS MAGAZINE PROFILE: Lewis Black, Our Angriest Comic]

“Richard has a way of approaching his art — even the background characters in his work, even the way the characters are walking — it’s very specific and very well-observed,” Docter tells Comic Riffs. “He’s a guy who really keeps his eyes open. He picks up on nuances and details. I knew that’s what we were looking for.”

Docter was more than impressed with Thompson: he also was intrigued by the mystery of his gifts.

“I don’t know how he does it — he finds these very specific weird things,” Docter says. “He will pick up things from his childhood. And I think: There’s no way — how did he remember that? Something specific from 35 or more years ago [that he brings] through these characters.

“There’s a truth he’s able to tap.”

Docter appreciates, too, that Thompson’s characters “don’t speak like kids, but they still evoke childhood. His characters are not tepid. There’s so much warmth, but there’s also a very specific kind of edgy. There’s a tendency to sand off the edges of characters, but Richard pushes them further.”

Docter also cites how Thompson sharpens his characters by creating a set of two — such as “Cul de Sac” siblings Alice and Petey Otterloop — whose personalities are diametrically opposed.

“We developed past that [for the film], obviously, but his sense of character, of being able to tap into that — real observations from his life and who knows where else,” says Docter, noting that viewers might be able to detect hints of Alice in his character Joy when the film comes out this summer.

And then, of course, there is the visual style that Docter so deeply appreciates: “Richard’s stuff looks approachable … but there is so much understanding going on here. It’s a little scratchy, but beautiful. He makes it look so easy.”

And then Docter offers one last kind of compliment — of the type specific to artists.

“Inspired by his comics, I wrote him to ask: What kind of pen do you use?” says Docter, before waiting a beat. “As if I would be able to draw as well as him if I used the same pen.”