The director of the new David Bowie documentary Moonage Daydream told how the project became an extremely personal experience after he suffered a heart attack early in its production.

Brett Morgen – previously known for the Kurt Cobain film Montage of Heck – was 47 when he began sifting through more than 5 million items from Bowie’s archive in 2017, choosing the elements that add up to his 140-minute analysis of Bowie’s output in the late artist’s words and works.

“One of the greatest legacies anyone can have is to continue to inspire when we're no longer here, and David does exactly that," Morgen told the BBC in a new interview. “David Bowie changed my life. I first came to him as I became a teenager, and his impact was tremendous.”

He noted that "then, just as I started working on this film, I suffered a massive heart attack. I flatlined for three minutes and was in a coma. My life was out of control, and I was entirely work obsessed. I put all my ego into my work, and I’m the father of three kids. When you have an experience like that, you think, 'What’s been the message of my life? Work hard and die in your 40s?'

“I needed to learn how to live again, and that’s when David Bowie really came back into my life at the age of 47. He [once] transitioned me from childhood, and then he transitioned me from being a man-child to being a proper father. That to me was his greatest gift. I had no idea going into this how he would impact my life.”

One of the key things Morgen learned from Bowie was the benefit of feeling "uncomfortable," he said. “He just wanted to make the most out of every day, and recognised that feeling comfortable is a falsehood," he explained. "If it’s easy, why do it? So once Bowie mastered something, he moved on."

As a result of his experiences, he added, it was the first time he didn’t feel the need to read reviews of one of his movies. “Regardless of whether anyone likes the film, I got so much from David, it was such a personal experience for me,” he said. “I’m blessed that I could spend that time with his image and his voice.”

Moonage Daydream premiered at the Cannes Film Festival earlier this week. Its general release is expected on HBO later this year.

Rock Stars Whose Lives Are Being Turned Into Movies

'Bohemian Rhapsody,' 'Rocketman' and 'The Dirt' have opened the floodgates.