Two film communities seek out different sides of Morocco — and gravitate to different hubs within the territory.

Foreign helmers prefer Ouarzazate and Marrakech for their desert no man’s lands and Arabian Nights settings, which have catapulted Morocco to the status of a major location for the international community.

The local industry, by contrast, is concentrated in Morocco’s biggest city, Casablanca, and tackles modern, urban issues.

“Foreign sales agents often complain our films don’t feel Moroccan enough,” quips helmer Swel Noury, whose love-triangle pic “The Man Who Sold the World,” which will premiere at the at the Marrakech Film Fest, is set in a postapocalyptic Casablanca.

Morocco — perhaps more than any other Arab state — warmly embraces foreign cultures, fueled by its Atlantic location, French-speaking tradition and the presence of multiple foreign TV channels (75% of homes have satellite dishes).

When cinephile modernizer King Mohammed VI ascended to the throne in 1999, he made cinema a national priority.

Since 2004, the Moroccan Cine­matographic Center (CCM) has doubled its funding budget. It now stands at $8 million per year, offering an average of $500,000 per film. CCM director Nour-eddine Sail has championed freedom of speech and films that challenge taboos.

Moroccan cinema is the driving force of the new spirit of freedom sweeping through the country,” exclaims director Nour-eddine Lakhmari, whose high-adrenaline film noir “Casanegra” is this year’s biggest hit, with more than 350,000 admissions; kudos at Dubai, Taormina and Brussels; and status as Morocco’s foreign-language Oscar submission.

Lakhmari believes that cinema is playing a key part in forging a new sense of national identity in Morocco. “Many Moroccans believe paradise exists abroad, but I want to show them it can exist at home if we fight for it.”

Other directors have used comedy to explore changing social and gender roles. In Zakia Tahiri’s “Number One,” macho manager Aziz is transformed when his wife sprinkles a magic potion into his dinner. In Aziz Salmy’s “Veiled Loves,” female lead Batoul is torn between conservative mores and a torrid love affair with a divorced man (she chooses the latter).

Such films generate fierce criticism from conservative and fundamentalist Islamic quarters, but filmmakers welcome the visibility. Faical Laraichi, prexy at pubcaster SNRT, believes this gutsy confidence reflects the sector’s maturity. SNRT now has its eyes set on the international market and is currently completing a $3 million, 32-episode epic historical series, “Stranger,” by female director Layla Triki, shot in classical Arab.

SNRT has also co-financed the second stage of Nabil Ayouch’s ambitious “Made in Morocco” slate, which has just wrapped 12 features by new directors.

“There’s a good energy in the local industry,” Ayouch concludes.