Ever watch a movie and then about two-thirds of the way through there's a gratuitous sex scene that does little to advance the plot and only seems to exist to offer up the film's female star as an object of sexual fantasy? Of course you have. It's something Hollywood has been doing at least since the Hayes Code was relaxed.

In case you had any doubts that sometimes these scenes can be as shallow and objectifying as they seem, one of Hollywood's top screenwriters, Aaron Sorkin, is here to confirm it's true. In fact, he says that he was once told to write a crude sex scene for Nicole Kidman at the last moment. When he protested, the film's director told him to "write what you’d like to see Nicole Kidman do."

The film in question was 1993's Malice, a twisting and turning (and mostly forgotten) potboiler of a psychological thriller co-starring Alec Baldwin that was met with mixed reviews then and certainly doesn't hold up too well in retrospect.

“Early on in my career, I wrote a movie that I’m not very proud of at all, it just turned into a mess,” Sorkin confessed in conversation with *USA Today.*

"The director, very close to the start of photography, decided that we were missing a sex scene between Alec and Nicole," he continued. "I went back to the hotel and I wrote like four pages of banter that ended with them falling into bed and we cut to the next day."

Director Harold Becker wasn't satisfied with Sorkin's tepid efforts. He wanted something steamier.

"I hadn’t written that much at the time, I’d only written A Few Good Men. And I said, ‘Boy, exactly what do you mean?’ And he said, ‘Look, it’s easy, just go back to your hotel and write what you’d like to see Nicole Kidman do.”

Not, "Write a love scene that actually moves the plot forward." Not, "Hey, at least use their lovemaking as an attempt to flesh out the character's personalities." Not, "Maybe check in with the actors first and see what they're comfortable with." Just "write what you'd like to see Nicole Kidman do."

Kidman at the time of filming, by the way, would have been about 25 years-old (nine years younger than Baldwin, and 14 years younger than the film's other lead, Bill Pullman, who played Kidman's husband).

Sorkin reports that he was just as creeped out, and refused.

“First of all, I just did a movie with her husband (Tom Cruise)! And second of all, no, I’m not going to write down what I’d like to see Nicole do and then hand the pages out to the crew and Nicole.”

He says eventually Becker did work out the scene himself with Baldwin and Kidman's involvement.

In the midst of so many sexual harassment and assault stories in Hollywood that go on late at night or behind closed doors, it's worth talking about how misogyny and sexual harassment can be built right into the movie-making process. That would include tacking on steamy sexy scenes at the last minute. Not that's there's necessarily anything wrong with gratuitous scenes in movies, but the process of creating them should be conducted with the utmost professionalism and everyone involved she be consenting, comfortable and well aware of the content at the time they sign on.

As for the rest of Malice, the film seems woefully problematic otherwise.

A young Gwyneth Paltrow appears as the victim of a serial rapist and murderer. The particular scene has nothing to do with the main plot, and only serves as misdirection. Basically the worst type of violence imaginable that could be inflicted on a woman is used as little more than a red hearing.

Kidman's character, meanwhile, starts the film as the picture of female purity. She's a young wife who teaches art to children. How nice! Spoiler alert, by the end of the film she's revealed to be a manipulative con artist and source of all evil. Not only that, but she's willing to give up her uterus (hence her ability to have children) in a scheme to make money and then ends the film attempting to kill a child (the anti-choice sentiments of the film seems ripe). It is, as Sorkin admits, a mess.

Sorkin, the writer of films like The Social Network and Moneyball, has attempted to prove on his depiction of female characters since. His latest film, and his first as a director, Molly's Game stars Jessica Chastain. He also says that he left Chastain's wardrobe choices, which can get a bit racey in the film, up to the actress and the female costume designer.

Unfortunately, such misogynistic sentiment remains in Hollywood. Even Kidman is still dealing with it. According to reports, former Amazon Studios executive Roy Price claimed he told staffers he wouldn't have been interested in picking up Big Little Lies unless Kidman and co-star Reese Witherspoon did nude scenes.

Nicole Kidman Could Go on "Survivor" and Crush It: