An animation studio based in Pasadena created animated sequences for “Middle School: The Worst Years of My Life,” a family comedy that will hit theaters today.

Fifty artists from Duncan Studios — including animators, effect artists, background painters, and ink and paint artists — have created 10 animated sequences for the upcoming movie, which blends live-action with animation, according to the Animation World Network.

“Creativity is the foundation of Middle School: The Worst Years of My Life and we were incredibly fortunate to have the Duncan Studio team working with us to realize these integral parts of the film,” said Steve Carr, the film’s director, to Animation World Network.

The movie, which is based on a bestselling novel written by James Patterson, follows an excited student named Rafe as he goes through his first day of middle school. Along the way, he discovers that his teachers and principal are oppressive cruel bullies, so he and his friends decide to form an insurgency against them.

The film also takes an interest in Rafe’s personal life as he struggles to hide his rebellion from Jeanne, the girl of his dreams and when his mother’s boyfriend — a mooch named Bear — threatens to become his stepfather, according to the film’s synopsis.

The team was supervised by animation director Chris Sauve and president of Duncan Studios, Ken Duncan, who both oversaw the production of the film’s animated sequences.

“We feel honored to help bring one of his books to the big screen, as well as a sense of responsibility to keep the animation elements true to his story and to director Steve Carr’s vision,” Duncan said to Animation World Network. “The animation sequences in the film add to the overall themes in the book, to encourage and allow creativity and the imagination to flourish, to avoid becoming constrained and regimented.”

Actors featured in the film include Griffin Gluck, Lauren Graham, Rob Riggle, Thomas Barbusca, Isabela Moner, Andy Daly and Andy Pally.