A phenomenon like “Hamilton” has a way of changing the careers of everyone involved. Doors open; offers flood in. In the case of Daveed Diggs, who won a Tony for his dual roles as the Marquis de Lafayette and Thomas Jefferson in the hip-hop Broadway musical, it meant finally getting to make his dream movie project, “Blindspotting,” a script he’d been developing with his longtime creative partner Rafael Casal well before he met Lin-Manuel Miranda.

Set in Diggs’ hometown of Oakland, “Blindspotting” features him in his first leading screen role, playing an ex-con with three days left on parole, whose volatile best friend (portrayed by newcomer Casal) could jeopardize his freedom.

This incredibly timely cultural powder keg of a movie about race relations in contemporary America will kick off the dramatic competition at Sundance, premiering Jan. 18, the opening day of the festival. It will be the first time U.S. distributors get a look at the low-budget film, financed by Culver City-based indie production company Snoot Entertainment. To direct the feature, Diggs and Casal tapped first-timer Carlos López Estrada, who had masterminded several of the pair’s more ambitious video projects.

Enlisting their musical talents, Diggs, a biracial rapper, and Casal, a white-Hispanic spoken-word artist, use the film to address the everyday racial tensions and class differences aggravated by gentrification.

In addition to its simmering socioeconomics, “Blindspotting” also serves as a powerful indictment of the broken dynamic between police and people of color, both in Oakland specifically and in America at large.

“The best way to make a piece about something like race is to understand that you’re not an authority on the subject,” Diggs says. “The thing we are an authority on is our vision of what Oakland is, so we let that dictate everything.”

Casal was piqued by Diggs’ demo CD. But Diggs’ big break came later: “I met Lin-Manuel Miranda because of a clerical error,” he says.

True to the way hyperliterate, politically engaged Bay Area residents express themselves, Casal’s and Diggs’ characters find it possible to riff and sometimes even joke about such weighty subjects in everyday speech. “Because [something like police shootings] is so normalized for them, it’s no longer a serious subject to bring up,” Casal explains. “It’s like bringing up the weather. You’re not complaining about the cold, you’re just stating that it is.”

Diggs was living four blocks from the Fruitvale BART station when Oscar Grant was murdered there in 2009, which inevitably filtered into the screenplay — though “Blindspotting” doesn’t presume to have the solutions to such complex social problems, which was one of the things that excited López Estrada about directing the film.

“I think the movie asks a lot of very direct, complicated and sometimes uncomfortable questions,” says López Estrada. “And although all the characters in the movie have really strong points of view, they’re leaving it up to you to decide.”

Today, thanks to “Hamilton,” Diggs, 35, may be the more established half of the “Blindspotting” duo, but that wasn’t the case when he moved back to Oakland after earning his theater degree from Brown. Though four years younger, Casal had already made a name for himself on the Bay Area spoken-word scene, from which he was plucked to appear on HBO’s “Def Poetry.”

Casal had set up a recording studio with the aim of finding other musicians to collaborate with, reaching out to Diggs on the strength of a demo CD the rapper had recorded in his college dorm room. The friendship took hold almost immediately: That first night, they created a few songs, which led to albums, live performances (with a group they dubbed the Getback) and countless sketches and online videos.

“Rafael was the most famous person I knew,” Diggs recalls. “He had really tapped into the YouTube audience pretty early.”

Casal’s videos caught the attention of Jess Calder (then Jess Wu). The young producer, partnered in Snoot with her husband, Keith Calder, had seen a couple of his spoken-word performances and was struck by both Casal’s charisma and the fact that he appeared to be a natural-born storyteller.

“In my mind, anyone who can tell a great story can definitely translate that to film,” explains the producer, who contacted Casal and proposed they meet for coffee. She asked if he’d ever thought about writing a screenplay.

“I’d thought about theater a lot, [but at that age] you’re trying to get $5 for something at McDonald’s. A movie is millions of dollars away,” says Casal. But he was definitely intrigued, and began fleshing out a character that was loosely autobiographical. Things started to click about a year and a half later, when the Snoot duo asked Casal to perform at a screening of their documentary “Thunder Soul” at a January 2009 presidential inauguration event in Washington, D.C. Casal couldn’t make it but suggested they book Diggs in his place.

“Daveed came and did like 15 minutes of freestyle at the event and kind of blew our minds,” recalls Keith Calder. “We were immediately like, ‘Rafael, the movie’s gotta be about the two of you!’”

And from that moment forward, “Blindspotting” became the story of two friends of different races forced to consider the world from one another’s viewpoints, all set against the rapidly changing Bay Area backdrop.

Casal hails from Berkeley, the city directly north of Diggs’ Oakland. But they both attended Berkeley High School and later split a four-bedroom house with two other friends for $1,200. “I can’t even imagine what that place would cost now,” Casal says.

Gentrification, fueled by the tech boom, has transformed the neighborhoods they once knew. “Seventh Street is just a BART station and a post office now, but in the ’30s and ’40s, that was one of the jazz and blues centers of the world,” Diggs says. The last of the local music venues, Esther’s Orbit Room (where Diggs’ brother had been a bartender), finally shut down in 2010. His mother and father (also born in Oakland) both had to move, priced out by the newcomers.

“The Bay Area is known for slang and for turn of phrase. It’s the evolution of pimp culture, so heightened language is already very prevalent in the way people relate to each other.”
Rafael Casal

Though not a musical in the conventional sense, “Blindspotting” was born out of a desire to translate spoken-word poetry into cinema. “There are versions where it was damn near a poem the whole time,” Diggs says.

From 2009 onward, he and Casal worked on the script together, huddling over the same laptop since they had only a single licensed copy of Final Draft between them.

“We were trying to find a recipe for a world where verse could exist without it feeling like there’s a deliberate shift every time it goes into a number,” Casal explains. “The Bay Area is known for slang and for turn of phrase. It’s the evolution of pimp culture, so heightened language is already very prevalent in the way people relate to each other.”

For the next several years, Diggs and Casal spent their time driving up and down Interstate 5 between the Bay Area and Los Angeles, parking out front of wherever Snoot headquarters happened to be at the time and sleeping in their car if needed. They wrote draft after draft of “Blindspotting,” pitching the changes to the Calders while using Snoot’s facilities to work on music videos and other projects.

“I’ve always felt like our offices were a place where they should feel safe to create art,” says Jess Calder.

Before Diggs and Casal could complete a shooting version of the script, they were pulled away by other professional opportunities. Casal went off to teach verse-driven theater at the University of Wisconsin-Madison for three years. And, for Diggs, “Hamilton” happened.

“The thing about this business is you never know if something’s a break,” says Diggs. “I met Lin-Manuel Miranda because of a clerical error.” Diggs showed up for the same substitute teaching job as one of Miranda’s friends, Anthony Veneziale, who was also a rapper. They hit it off, and Veneziale invited Diggs to freestyle with his group, of which Miranda was a member. Later, when it came time to do an early reading of “Hamilton,” Miranda remembered Diggs and his rapid-fire delivery. “I was invited because I have this particular skill set that allows me to learn a lot of things very quickly,” recalls Diggs, who had just five days to memorize the show’s most demanding part. “I assumed they would replace me because they had plenty of Broadway performers to choose from.”

Except that Miranda didn’t replace Diggs, who spent nearly a year and a half with the production. “Before leaving ‘Hamilton,’ I made this comment to one of my agents,” Diggs recalls. “I was ready to go, but scared that I wouldn’t make any money again, and he said, ‘Don’t worry about that,’ and promptly booked my life with all these things.”

The day after his last “Hamilton” performance in mid-2016, Diggs found himself shooting the movie “Wonder,” starring Julia Roberts. The following week, he began working on ABC’s “Black-ish.” That was swiftly followed by a recurring role on “Unbreakable Kimmy Schmidt,” which had to be juggled amid a long-planned national tour with his experimental rap group, Clipping.

Into the midst of this whirlwind came the moment for which Diggs and Casal had long been waiting. Last March, the Snoot producers told them they had the greenlight to make “Blindspotting,” provided the duo could get their script in shape to shoot in June.

“What if I move to L.A. in two days and I write it for a month?” Casal recalls asking — and that’s exactly what he did, undertaking a page-one overhaul while Diggs’ fledgling screen career kept him busy.

“I was on airplanes every other day,” says Diggs, “so really the only through line were these midnight phone calls from Rafael to talk about this thing we’d been talking about for a decade.”

Excited about the prospect of finally making the movie, Diggs kept a rare 25-day window open in June for the shoot. Casal managed to get the rewrite done in four weeks. Reaching out to another old friend, they brought in director López Estrada, who immediately began pre-production.

The project’s Oakland focus attracted some production talent whom the producers normally couldn’t afford, including DP Robby Baumgartner, who had worked in the lighting department for Spike Lee, Paul Thomas Anderson and Alejandro González Iñárritu, and who brought the lighting crew from “Moonlight” aboard.

“We suddenly had this amazing team of people from the Bay Area,” says Diggs. “Doing something with your friends at a high level, that’s a dream.”

After production wrapped, Snoot submitted a rough cut to Sundance, which recommended the music-driven film for a Dolby Family Sound Fellowship. “Blindspotting” is one of two 2018 Sundance selections to have earned the generous post-production grant, making it possible for the filmmakers to upgrade their mix in time for its festival debut. (Past recipients of the grant include “Mudbound” and “Beasts of the Southern Wild.”)

Thanks to the grant, Diggs, Casal and other members of the production team — including López Estrada and the Calders — spent late December camped out on the Paramount Pictures lot on the same Technicolor stage where Michael Bay mixes his “Transformers” films.

On the same day of Variety’s visit, Diggs and Casal wrote a short piece of original music to replace a few seconds of temp score. Since they came up with the cue themselves, that means they can later expand it into a full-blown song for the soundtrack.

It’s the kind of on-the-fly challenge that has fueled the duo’s creative partnership for more than a decade — though “Blindspotting” is the first time they’ve been able to combine their writing, performance and musical talents to such a degree.

“As an artist, the only thing you ever want to do is something that requires every part of yourself,” Diggs says. “And it is so rare when that happens.”