This seems to be the year for sweet but sorrowful endings in animation. Two of the medium’s most popular franchises — “How to Train Your Dragon” and “Toy Story” — wrapped up their stories by making sure audiences got what they needed even if they weren’t quite ready to say goodbye.

With the release of “How to Train Your Dragon: The Hidden World,” helmer Dean DeBlois came to the end of his own decade-long relationship with Toothless and Hiccup. He always had the end in mind, even at the beginning.

“I saw the opportunity to do something akin to those initial three ‘Star Wars’ films that I grew up with. You can tell a story that expands the world and deepens the characters and continues the adventure, but in a way that it doesn’t feel like a miscellaneous next adventure with the same five or six characters, which is often the case with sequels,” DeBlois says. “So, I saw an opportunity for there to be one story told in three stand-alone films that were interconnected with their scenes and stories.”

Toy Story 4” brings the film series that launched Pixar to a possible close. Though helmer Josh Cooley and producer Jonas Rivera won’t call it the definitive end to the series, it did occur to them that this could be the last one.

“We wanted this to be satisfying, to honor these films and to feel good about it if it was the last one, even though you never know if we’ll come back to this story,” Rivera says. “We realized that ‘Toy Story 3’ was really the end of Andy’s journey and that Woody’s journey still needed an ending. Who was he going to become now that he didn’t have one child to look after? Maybe the next thing for him was to play and be there for many children.”

Cooley also thought of Bo Peep as a critical part of Woody’s journey. Woody’s mission had always been focused on one specific child, but the brave, porcelain character that used to be part of a lamp offered a way to help the lonesome cowboy make that leap to the next thing.

“She was a catalyst for Woody,” Cooley says. “It reminded me of my relationship with my wife because she was definitely a catalyst for me, someone who I would listen to and trust. Without Bo Peep, Woody would have a very hard time going out of his comfort zone. But since she’d already moved on and Woody cared about her so much, it made sense that he was willing to listen to her. We were building on the relationship that had already been there in the background over the last three films.”

And “Hidden World’s” Hiccup — much like Woody — has to find a way to move on. He has been like a parent to his dragon, Toothless, and cared for him the way Woody cared for Andy — even though we all know that can’t last forever.

“It’s a bittersweet thing in that saying goodbye to characters that we’ve come to know so well, and saying goodbye to our cast and our crew that work together for the last 11 years,” says DeBlois. “But we held to our intention that we wanted to tell a story about characters that come together for a period of time and have a profound impact on one another’s lives. Even though they part ways, they are permanently changed and there’s something very life affirming about that. I was really happy to hear that people are reluctant to move on because it’s so much better than being over it.”