Kelsey Mann was scanning some old photos when he came to a series of pictures from his childhood birthdays and was struck by what he saw. “I was 5, and it’s my birthday, and I’m sitting there in front of my cake ..

. I think it was the smile and the joy on my face that made me stop,” says the director of “Inside Out 2.” “I’m like, ‘Wow, I am really enjoying the hell out of this moment.

’ Then I turned 8, and my smile went down. I turned 11; it went down even further. Then 13, and I’m just staring at this cake, wishing I was anywhere but there.

“So I thought, ‘What the hell happened?’ ” “Inside Out” had been a huge hit for Pixar in 2015. The comedy about 11-year-old Riley’s emotions, led by Joy, struggling to find balance within her grossed more than $850 million and won the animated feature Oscar. Naturally, with a sequel in mind, the studio’s writers had been continuing to learn how the mind works.

“A lot of us [were] doing the research of what goes on in the brain — suddenly, I — ‘Oh, I understand what I was doing,’ ” Mann says of the change in his photos. “This is the time when you become really self-conscious and compare yourself to others. .

.. I hated the attention.

I just wanted it to be over. So that feeling of not feeling good enough is where a lot of this began.” “Welcome to Pixar,” says “Inside Out 2” co-writer Dave Holstein, to laughter from Mann and co-writer Meg LeFauve, over a video chat.

“We start at.