LOS ANGELES — “The Wizard of Watts,” a coming animated television musical, was conceived two years ago as a big, fat gob of raucous entertainment wrapped around a nugget of racial commentary.

Then, with the musical’s animation already far underway, Ferguson, Mo., became a flash point, starting a national debate about race, overzealous policing and the need for officers to wear body cameras. Then came the phrase “I Can’t Breathe” and the broader protest against police brutality.

Suddenly, “The Wizard of Watts,” with its devastated black neighborhoods and army of pigs, took on greater weight. How the musical will be received by viewers at a racially charged cultural moment is anyone’s guess. But when it arrives on Cartoon Network’s after-hours Adult Swim block on Saturday, “The Wizard of Watts” will at the very least become one of those eerie instances of art accidentally mirroring life.

The primary villain in the Magical Land of Oz-Watts, where the story takes place, is a vicious pig clad in riot gear. Water does not neutralize this Oz villain; instead this baddie gets melted with a camcorder. “Oh, no! Not an irrefutable visual record of my illegal actions!” the anthropomorphized pig wails as he turns to mush at the musical’s climax.

Even Carl Jones, the director of “The Wizard of Watts” and one of its writers, was surprised at hitting such a cultural bull’s-eye.

“I take pride in tackling things with my gloves off, but animation takes such a long time to produce that you usually don’t end up being all that current,” he said.

Mr. Jones had noticed on social media how African-Americans were increasingly using cellphone cameras as “protection from police, like as a weapon,” he said.

“Nobody was talking about it and so I decided we had to take it on,” he said.