The breakup between Jennifer Lopez and Ben Affleck was the source of inspiration for a scene in the singer's new film VIDEO

Jennifer Lopez's new musical film, This Is Me…Now: A Love Story, contains many Ben Affleck allusions, including a brief appearance by the actor himself. But one particular scene was inspired by their relationship, reports Business Insider .

In one sequence, Lopez plays a brave female employee in a “heart factory.” Suddenly, an alarm goes off, warning the employees of an impending catastrophe: the massive heart at the center of the factory is failing.

According to director Dave Meyers, the idea came from an emotional conversation with Lopez. When the two began thinking about the film, Lopez spoke to Meyers about her breakup with Affleck in the early 20s and the painful aftermath of the split. (She went through a divorce and another broken engagement before reconciling with Affleck nearly two decades later.)

Their first breakup was very, very difficult for herMeyers told the source.She opened up more than I thought she would about what this meant to her and I could see there was still a lot of pain there.”

Jennifer Lopez and Ben Affleck met in 2001. Photo: Archive

The scene is action packed, elaborate and completely melodramatic. Meyers stated that this effect was intentional; he took cues from movies like “Titanic” and “Howl's Moving Castle,” presenting heartbreak as a “life and death”.

The factory also serves as the venue for “Hearts and Flowers”, the ninth track from the album “This Is Me…Now”,

Symbolically, Lopez's character in the film is determined to mend the broken heart. She gets dressed and climbs inside the car, engulfed in flames and explosions.

Jen has this raw toughness, so I wanted to figure out how to exploit thatMeyers said.I thought, “She would be someone who would work hard to make sure the heart doesn't die,” and she did in real life.”

During a recent interview with Variety magazine, Lopez was candid about her relationship with Affleck.

The two met in 2001 on the set of the film 'Gigli' and quickly became the talk of the tabloids. After two years together, they broke up just days before their wedding date, citing “excessive media attention”.

Our relationship crumbled under the weight of the pressure,” Lopez told Variety.

The film depicts Lopez's life following her breakup with Ben Affleck.