Today, "Enchanted" may feel as beloved as any other Disney fairy tale, but when it was released ten years ago this week (on November 21, 2007), the story of a cartoon princess transported to flesh-and-blood New York City was considered a risky project for Disney.

A lavish live-action/animation blend of the sort the studio hadn't tried for two decades, it featured an untried leading lady and a script that lampooned the princess musicals that had been the studio's signature fare for 70 years. Fortunately, "Enchanted" became a worldwide smash, earned three Oscar nominations, and made a star out of Amy Adams.

It's a wonder the movie worked so well, given the long struggle to get it made. The result could have been something a lot different -- less kid-friendly, and with another leading lady. Here, then, are the secrets of how the filmmakers overcame those obstacles, brought the fantasy realms of Andalasia and Manhattan together, and got all those rats and pigeons to clean Patrick Dempsey's apartment.

1. It took a decade for Bill Kelly's screenplay to reach the screen. In part, that's because the script was initially R-rated; in one risqué sequence, poor stranded princess Giselle gets mistaken for a stripper. Disney bought the screenplay, but planned to release it through one of its grown-up imprints, not family-friendly Walt Disney Pictures.

2. Over the next ten years, the musical project went through numerous script doctors and four directors, including Rob Marshall (who ended up making "Chicago" for Disney's Miramax instead), Jon Turteltaub (who wound up making Disney's "National Treasure" movies), and Adam Shankman (who'd go on to direct "Hairspray"). Disney finally hired Kevin Lima (the co-director of its animated hit "Tarzan") and returned the script to Kelly for one last rewrite.

3. Among the initial casting choices for Giselle were Reese Witherspoon and Kate Hudson. Adams didn't land the part until after her Oscar-nominated supporting performance in 2005's "Junebug" put her on Disney's radar.

4. Since Adams was a non-entity at the box office, Disney sought insurance by seeking a better-known leading man to play jaded divorce lawyer Robert. Grey's Anatomy" star Patrick "McDreamy" Dempsey.

5. Future "Frozen" princess Idina Menzel got to play Robert's fiancée, Nancy. At the time, she was best known for having starred on Broadway in both "Rent" and "Wicked" -- musicals whose billboards can be seen in the film's Times Square scenes. (There's also a billboard for "Hairspray," the film version of which featured Marsden.) "Wicked" lyricist Stephen Schwartz wrote the songs for "Enchanted" with frequent Disney composer Alan Menken.

6. Several actresses who starred in Disney musicals have cameos in "Enchanted." Jodi Benson, who voiced Ariel in "The Little Mermaid," plays Robert's assistant Sam. (Fittingly, she shares a scene with Giselle that involves a fish tank, while "Mermaid" ballad "Part of Your World" plays in the background.) Paige O'Hara, who starred as Belle in "Beauty and the Beast," plays a soap opera character named Angela, who shares a scene on her TV show with a character named Jerry (apparent references to "Beauty" co-stars Angela Lansbury and Jerry Orbach). Judy Kuhn, who sang for the title character in "Pocahontas," plays Robert's pregnant neighbor. And Mary Poppins herself, Julie Andrews, is the film's voiceover narrator. (Giselle's twirl on a hill in Central Park is an homage to the opening scene of Andrews' "The Sound of Music.")

7. Lima has said there are thousands of Easter eggs in "Enchanted" that call back to older Disney films. Among them: The Italian restaurant where Robert and Giselle share a pizza is called "Bella Notte" (above), named after the song from the Italian restaurant scene in "Lady and the Tramp." (And notice the Mickey Mouse silhouette made of peppers on their pie.) The troll that nearly kills Giselle wears rags made from famous Disney princess costumes and earrings made from Ariel's shellfish bra. Nancy's last name is Tremaine, like the wicked stepmother and stepsisters in "Cinderella." Robert's last name is Philip, after the prince in "Sleeping Beauty." The Afro-puff hairdo worn by the Times Square bus driver looks like Mickey Mouse ears. And the hotel TV that Edward watches plays nothing but Disney clips.

8. Lima has a cameo of sorts in the movie as the yipping voice of Andalasian chipmunk Pip, once he's transported to New York and loses the ability to speak English.

9. The Disney studio may have pioneered hand-drawn animation in feature films, but by 2007, Disney was a computer-animated shop with hardly anyone left who could create the 13 minutes of hand-drawn animation "Enchanted" required. Disney had to farm those scenes out to one of its former animators, James Baxter, who ran his own animation studio in Pasadena.

10.Mona May, the costume designer best known for her colorful "Clueless" clothes, created the costumes for "Enchanted." Most elaborate was Giselle's poofy wedding dress, which included a hoop skirt that had 20 layers of petticoats. Adams said it was hard to move while wearing it because it weighed 45 pounds.

11. During the "Happy Working Song" sequence, among the CGI cockroaches, pigeons, and rats who swarm and clean Robert's apartment, there are some real birds and rodents. "We had a whole room full of live rats and pigeons," Adams told Collider. "Not all of them. You can't train them to scrub a toilet. I've tried. I would love if you could train animals to do the dirty work, but we did have live rats and pigeons and no cockroaches. I don't work with cockroaches."

12. Lima has said the hardest sequence to film was the "That's How You Know" number, shot in Central Park. It took 17 days, with shooting made difficult because of bad weather and overzealous Dempsey fans.

13. Menzel was supposed to sing "Enchanted," a duet with Marsden, but it was cut from the film.

14. Disney had hoped to cash in on merchandising with a Giselle doll, the studio's first to be modeled in the likeness of a real person rather than a cartoon. But then Disney's lawyers discovered that they'd have to pay Adams to license her image for the rest of her life, so the doll was scrapped.

15. "Enchanted" cost a reported $85 million to make. It earned back $128 million in North America and a total of $340 million worldwide.

16. Three of the movie's five songs were nominated for Oscars: "Happy Working Song," "That's How You Know," and "So Close."

17. It's taken even longer for an "Enchanted" sequel to get off the ground than it took to make the original film. As with "Enchanted," the sequel has gone through several writers and directors. Most recently, in October 2016, Disney announced that the movie would be called "Disenchanted," with Shankman set to direct and Adams set to return as a Giselle who's having second thoughts after ten years of marriage. "Disenchanted" was supposed to film Summer 2017 and be released next year, but we haven't heard much since last October's announcement.

Like Giselle, we may have to wait a while longer for our happily ever after.