Lyonne's journey to "Ad Astra" started with the smell of James Gray's cooking wafting down the halls of her Los Angeles apartment building.

“Russian Doll” Emmy nominee Natasha Lyonne knows what it takes to get a part. Which is how she ended up in James Gray’s outer-space odyssey “Ad Astra,” in a small role as a Martian dweller who, in her usual, unvarnished New Yorker swagger, basically says, “Welcome to Mars!” to Brad Pitt’s sad-faced astronaut with daddy issues.

As revealed during a New York Q&A with James Gray at the Metrograph moderated by IndieWire’s David Ehrlich, Lyonne’s journey to “Ad Astra” started with the smell of the director’s cooking.

“Every Sunday night I make dinner. It’s a tradition we like. It’s a nice thing and we invite people over and have a lot of guests. It’s a wonderful thing,” Gray said. “One day I’m walking down the hall and I see Natasha Lyonne walking towards me, and she says, ‘Honey, I know who you are. You’re James Gray.'”

The “Orange Is the New Black” star told Gray, “I’m smelling it. Every Sunday, I smell it. What’re you doing to me?” And so Lyonne came to dinner at Gray’s, where she asked him about his next movie, which he pitched to her as “Brad Pitt goes to space.”

Related Brad Pitt Follows Oscar Win with Surprise Emmy Nom for Playing Dr. Anthony Fauci on 'SNL'

Why the Unmade Version of 'Ford v Ferrari' with Pitt and Cruise Never Happened Related The Best Animated Series of All Time

Winter 2020 TCA Press Tour: Apple TV+ Announces Its New Shows

“Brad Pitt goes to space?” Lyonne said. “What am I doing in it? I’m in it. I’m in it.”

Months later, as production loomed, Gray called her up. “She’s quite brilliant. She’s a great actor. I’ve known her work from ‘Slums of Beverly Hills.’ She used to date Edward Furlong, who was in the first film I ever did, which was a movie called ‘Little Odessa,'” Gray said. “In any event, to make a long story longer, she comes to set, and she’s incapable of an uninteresting moment, which is weird because it was supposed to be just a cameo.”

Gray said that even the “Ad Astra” crew members were transfixed by Lyonne’s singular charm. “I kept seeing the cameraman keep putting the camera on Natasha Lyonne. I said, ‘Listen, buddy, I got Brad Pitt in the movie. Don’t go to Natasha Lyonne.’

“We wound up shooting the scene, and I kind of wished she was in more of the movie… I kept thinking, is this the Alan Cumming in ‘Eyes Wide Shut’ moment?” Gray told the audience, referring to Cumming’s eerie cameo in the 1999 Stanley Kubrick film as a bellhop who’s thirsty for Tom Cruise.

The actress is nominated for Outstanding Lead Actress in a Comedy Series at the Primetime Emmy Awards, taking place Sunday September 22. She also received an additional nomination, for Outstanding Writing for a Comedy Series (shared with Leslye Headland and Amy Poehler).

Lyonne’s blink-and-you’ll-miss-it walk-on in “Ad Astra” certainly makes an impression. The film is now in theaters.

Sign Up: Stay on top of the latest breaking film and TV news! Sign up for our Email Newsletters here.