Everybody knows “The Emperor’s New Groove,” the 2000 film from Walt Disney Animation. But beneath this buddy comedy is the skeleton of a movie that Disney had previously scrapped: “Kingdom of the Sun.”

“Kingdom of the Sun” (later “Kingdom in the Sun”) was a story that took place in the Incan Empire. It was about a poncho-clad commoner named Pacha, a power-hungry sorceress named Yzma and an emperor that transformed into a llama halfway through the film.

Sound familiar?

"Kingdom of the Sun" was a "Prince and the Pauper" type narrative, in which Emperor Manco (later changed to Kuzco, both voiced by David Spade) and Pacha (Owen Wilson) switch places. Pacha tries to come off as a convincing emperor and even starts to fall in love with Manco's betrothed. Manco tries to become a shepherd like Pacha, but he is eventually discovered by Yzma (Eartha Kitt) and gets turned into a llama instead. Yzma schemes with a rock creature named Hucua (Harvey Fierstein) to steal the sun and plunge the world into an everlasting night.

The film riffed on Inca creation myths and would have been directed by Roger Allers ("The Lion King") and Mark Dindal ("Cats Don't Dance"). It was intended to be a classic Disney animated musical, with songs written by Sting.

All animated films go through a trial-and-error process, but "The Emperor's New Groove" had a particularly rocky history. Many of the development and production difficulties were filmed by Sting's wife, filmmaker Trudie Styler, in a documentary called "The Sweatbox." Disney never released the documentary on VHS or DVD, though some footage from it is used in the special features of the "Emperor's Groove" DVD.

However, there are a few copies of "The Sweatbox" floating around on the Internet. I managed to get my hands on one, and I can say from experience, that it is one of the most enthralling and uncomfortable documentaries I have ever seen.

Styler captures the excitement of the creative team as they begin to put the pieces of "Kingdom of the Sun" together. Roger Allers is clearly devoted to the story. His eyes light up when he talks about the characters or a new idea that they've come up with. Lead character designer, Andreas Deja, swings his hips in front of a full-length mirror to inhabit the character of Yzma.

But Styler also captures the confusion that seems to have plagued the project from its inception. Only a few minutes into the documentary, Sting reveals that he's writing songs based mostly on hearsay and that he's not sure what's going on with the actual film. However, the creatives soon assemble a work print out of storyboards and pencil tests to screen for the executives in the eponymous sweatbox.

The sweatbox is a screening room at the Walt Disney animation studio in Burbank, named for the original screening room, which was a wooden shack with no air conditioning, but also for the anxiety such screenings provoked. The reaction of the execs could make or break a film.

After the screening, the executives assemble the "Kingdom of the Sun" team to inform them that "the movie isn't working."

According to them, the film is all over the place, with too many characters, plotlines and Inca mythology. One of the execs, Peter Schneider, offers an olive branch, saying that he liked Sting's music. When Sting tries to defend the original, epic scope of the film, he is politely ignored.

In the resulting chaos of the rewrites, both Roger Allers and Andreas Deja quit the film. Pacha is aged up, recast as John Goodman and Kuzco becomes the focus of the film. The art style is overhauled completely, focusing more on exaggeration and caricature. All six of the songs Sting wrote are cut completely. He begrudgingly agrees to write a new song, called "Perfect World," and to rehaul a love song from the old film into a song about Kuzco and Pacha's friendship: "My Funny Friend and Me."

The rest of the documentary details the launch of the newly-titled film, "The Emperor's New Groove," including these Happy Meal nightmares:

In a truly perfect world, both films could exist alongside each other. I would have liked to see a finished version of "Kingdom of the Sun," but I still love "The Emperor's New Groove." I always have. I love the jokes and the chase scenes. I love that Pacha looks like John Goodman. I love Kronk and Yzma's weird relationship. I love how quotable it is.

By some miracle, "The Emperor's New Groove" is great film. Someone did something right to deliver this comedic joyride from the massive pile-up that happened after the executive intervention of "Kingdom of the Sun." If we couldn't have that movie, then I sure am glad that we have this one.