Bryant surrounded himself with first-rate teammates in creating the film, including John Williams, the five-time Oscar winning composer, and Glen Keane, a former Disney animator.

In accepting his award, Bryant said: “As basketball players we’re supposed to shut up and dribble. I’m glad we do a little bit more than that.” It was an allusion to recent comments made by the conservative pundit Laura Ingraham, who scolded basketball players who had criticized President Trump to keep their political opinions to themselves and “shut up and dribble.”

The New York Times critic Glenn Kenny said the animation of “Dear Basketball” had “gorgeous fluency,” but that the film was "substance-free, an advertisement for itself. It deserves to not receive an Oscar for that reason alone.”

“Dear Basketball” triumphed over “Garden Party,” about animals taking over a deserted mansion; “Lou,” about the contents of a lost and found box teaching a lesson to a bully; “Negative Space,” about learning to pack a suitcase; and “Revolting Rhymes,” a Roald Dahl adaptation.

In a year with intense focus on improper sexual behavior by men, many of them in the entertainment industry, Bryant’s victory caused a stir. An outcry when the film was nominated repeated itself on Sunday night, with some viewers and commentators pointing out that Bryant had been accused of rape in 2003. That case was ultimately dropped when the accuser declined to testify. Bryant said he believed the encounter was consensual, but acknowledged later that the woman did not.