Actor T.J. Miller voiced the role of Tuffnut in the first two "How to Train Your Dragon" movies.

The role was recast for the third movie following reports of a sexual assault allegation against Miller and his arrest on charges of calling in a fake bomb threat.

Writer and director Dean DeBlois said the choice to recast the role "came [from] on high" and that he was "reluctant to make the change."

Actor T.J. Miller's role of Tuffnut in the "How to Train Your Dragon" trilogy was recast following reports of a sexual assault allegation and an arrest on charges of calling in a fake bomb threat.

"I was reluctant to make the change but it was a decision that came [from] on high, you know, tied to his headlines last year," DeBlois said in an interview with INSIDER Thursday. "So I went along with it, but it's regretful because he's such a comedic genius and he had given us some really great stuff."

For the final film in the trilogy, "The Hidden World," impersonator and comedian Justin Rupple took over the part.

Miller denied the assault allegation in a report published by The Daily Beast. Roy Rochlin/Getty Images for Advertising Week New York

"I didn't have a lot of say in the matter," DeBlois said. "I really liked T.J. as a person and he's been a friend. He's only ever done terrific work for us, including under ["The Hidden World"]."

DeBlois said Rupple's voice performance in "The Hidden World" was all done through ADR [Automated Dialogue Replacement] because the movie had already been animated to match Miller's recorded performance.

"We couldn't go back and change the animation, so we had to replace lines right down to the of the length and nuance and cadence," DeBlois said. "So it was a tough tough job that Justin took on, but I think he did really well. We replaced it as best we could so the character still felt intact. So yeah, it's unfortunately one of those things I didn't have much control over."

The final credits of "The Hidden World" feature animated title cards for each of the main cast of characters — with the exception of Tuffnut. Rupple's part is listed in the scrolling credits following the animated sequence.

When reached for comment, a spokesperson for DreamWorks provided the following statement:

"Last spring DreamWorks made the decision to replace TJ Miller in How to Train Your Dragon: The Hidden World. Justin Rupple joined the cast in the fall as the voice of Tuffnut and gave a fantastic performance. We are thrilled Justin joined the Dragon family."

Representatives for Miller didn't immediately respond to INSIDER's request for comment.