From Robby to R2-D2, Gort to HAL, robots both good and evil have been major characters in films.

Now Chappie joins their ranks. Played by Sharlto Copley, he stars in the eponymous Sony Pictures film from “District 9” and “Elysium” helmer Neill Blomkamp, set in a near future patrolled by a mechanized police force.

When Chappie — one of the police ’bots — is stolen and reprogrammed to think for himself, he turns from evil to good and becomes, in the words of the film’s promo materials, “humanity’s last hope, (even though he) isn’t human.” The movie, less dark than Blomkamp’s earlier dystopian dramas, is described as “a sci-fi action film with comedic elements” by cinematographer and frequent Blompkamp collaborator Trent Opaloch, who shot the pic over 65 days on location in South Africa using Red Epic cameras.

Opaloch captured all images of Chappie in movement by shooting Copley dressed in a tight, gray motion-tracking suit. Generally there were two passes, says the d.p. — one shooting Chappie as he interacted with the environment and other actors, and another to capture background information for the same scene.

“Everything Chappie does in the movie is driven by Sharlto,” Opaloch says, even though viewers see a robot, not a human, on the screen. “All the mannerisms, every single detail is there.”

For some of the action scenes, a stunt person performs in a similar suit. And other robots in the film are played by other gray-suited actors.

But “Chappie” differs from traditional mo-cap films in the way it used animators. Copley’s performance served “strictly as a motion reference, with all animation done by hand,” says vfx supervisor Chris Harvey. “There was no actual data capturing. It was traditional keyframe animation that matched his performance.”

Blomkamp eschewed conventional mo-cap because it’s more cumbersome on the set, Harvey notes. “You’ve got to have cameras set up all over the place to capture the full volume of the movement,” he adds. “Neill’s shooting style is very fast, and we wanted to have the smallest possible footprint and impact on set, just to let the creativity flow without getting in the way. We never had to say, ‘OK, we’ve got to stop and calibrate for motion capture.’ The actors didn’t feel like it was a big visual-effects movie. We just let them do their thing.”

In addition to the animated Chappie, Weta Workshop in New Zealand built physical Chappies for scenes in which the character is inactive. “There were torsos, limbs, whatever, depending on what part of the robot we needed,” Opaloch says.

The cinematographer’s biggest challenge was also one of the film’s most impressive assets: shooting a major sequence over three weeks in a giant abandoned factory that doubles as a
gangsters’ lair, where Chappie lives with his new parents, played by Yolandi Visser and Ninja of South Africa rap group Die Antwoord.

The sun’s rays kept creeping through apertures on the space’s walls and ceiling, moving around and making it hard to control the light, Opaloch says. But the facility also had its benefits. “It was an incredible backdrop, with a depth of 200 or 300 meters in some directions,” Opaloch explains.

Strangely, after photography wrapped, as the abandoned facility was being salvaged, it suddenly collapsed — epitomizing to the end the film’s dystopian vision.