Woody (voiced by Tom Hanks) is hoisted by his friends in “Toy Story 3.”Credit
Pixar Animation Studios/Walt Disney Pictures

“Toy Story 3” begins with a rattling, exuberant set piece that has nothing to do with the tale that follows but that nonetheless sums up the ingenuity, and some of the paradoxes, that have made this Pixar franchise so marvelous and so successful. The major toys — Woody (Tom Hanks), Buzz (Tim Allen), the Potato Heads (Don Rickles and Estelle Harris), Hamm (John Ratzenberger), Jessie (Joan Cusack), Rex (Wallace Shawn) and the others — are in a setting at once wholly unfamiliar and instantly recognizable. They’re in a western, albeit one made in the amped-up modern action style, rather than the more stately idiom of old-time oaters. A train is hurtling down the tracks; a bridge explodes; stuff is falling out of the sky. There are force fields and laser beams and a big noisy surprise every time you blink.

At first glance your heart may sink a little. Can it be that “Toy Story,” built over 15 years and two previous movies out of the unlikely bonds that flourished among a band of beautifully animated inanimate characters (and Andy, the mostly unseen boy who collects them), has succumbed to flashy commercial blockbuster imperatives? Or would we be fooling ourselves to suppose that it has ever been anything else?

The resolution of the opening scene in the latest episode shows this to be a false choice. The action is taking place in Andy’s head as he plays with his toys. All those crazy effects are the products of his restless and inexhaustible imagination, which is no less his for having been formed and fed by movies, television shows and the cheap merchandise spun out of them.

And how many real kids who have grown up with Buzz Lightyear and Sheriff Woody have unspooled their own improvised movies on the rec room floor? Perhaps no series of movies has so brilliantly grasped the emotional logic that binds the innate creativity of children at play to the machinery of mass entertainment. Each one feeds, and colonizes, the other. And perhaps only Pixar, a company Utopian in its faith in technological progress, artisanal in its devotion to quality and nearly unbeatable in its marketing savvy, could have engineered a sweeping capitalist narrative of such grandeur and charm as the “Toy Story” features. “Toy Story 3” is as sweet, as touching, as humane a movie as you are likely to see this summer, and yet it is all about doodads stamped and molded out of plastic and polyester.

Therein lies its genius, and its uncanny authenticity. A tale that captured the romance and pathos of the consumer economy, the sorrows and pleasures that dwell at the heart of our materialist way of life, could only be told from the standpoint of the commodities themselves, those accretions of synthetic substance and alienated labor we somehow endow with souls.

Cars, appliances, laptops, iPads: we love them, and we profess that love daily. Its purest, most innocent expression — but also its most vulnerable and perishable — is the attachment formed between children and the toys we buy them. “I want that!” “That’s mine!” Slogans of acquisitive selfishness, to be sure, but also articulations of desire and loyalty. The first “Toy Story” acknowledged this bond, and “Toy Story 2” turned it into a source of startlingly deep emotion.

When Woody chose life with Andy and the others over immortality with Stinky Pete at the museum, he was embracing a destiny built on his own disposability. When we grow up, or just grow tired of last year’s cool stuff, we don’t just put away those childish things, we throw them out. “Face it, we’re just trash,” says a bitter pink teddy bear near the end of “Toy Story 3.” Though the movie, directed by Lee Unkrich from a script by Michael Arndt (“Little Miss Sunshine”), labors to dispel the gloom of this statement, it can’t entirely disprove it.

As Andy prepares for college, Woody surveys the depleted ranks of his pals, noting that some have passed on (rest in peace, Wheezy) and reassuring the others that everything will be fine. They’ll live in the attic until the next generation comes along. But instead they wind up at the Sunnyside Daycare Center, which at first seems like a paradise where the problem of obsolescence has been magically solved. Lots-o’-Huggin’ Bear (Ned Beatty), its seemingly jovial patriarch, explains that there, toys are played with every day, and when one group of youngsters outgrows them, another cohort arrives. It’s a perfect reversal of the single-owner predicament, and most of the toys are relieved and happy — especially Barbie, voiced by Jodi Benson, who finds a Ken with a fabulous wardrobe and the voice of Michael Keaton.

The change of scene, and Woody’s subsequent journey to the home of a little girl named Bonnie (Emily Hahn), allows the filmmakers to introduce a bevy of new toys, including a talking phone and a purple octopus who sounds a lot like one of the hosts of “The View.”

“Toy Story 3,” which makes remarkably subtle use of 3-D, also explores a range of cinematic techniques undreamed of in the first two chapters, and refined in recent Pixar films like “Wall-E” and “Up.” There are swiftly edited action sequences worthy of a “Bourne” movie; low-angle compositions and nimble tracking shots; changes in the color saturation and the texture of the light — just like in a “real” movie! When the truth about Sunnyside is revealed, the movie has fun evoking prison escape pictures and horror films, darkening the Pixar palette to captivating (and, to some small children, possibly frightening) effect.

In providing sheer moviegoing satisfaction — plot, characters, verbal wit and visual delight, cheap laughs and honest sentiment — “Toy Story 3” is wondrously generous and inventive. It is also, by the time it reaches a quiet denouement that balances its noisy beginning, moving in the way that parts of “Up” were. That is, this film — this whole three-part, 15-year epic — about the adventures of a bunch of silly plastic junk turns out also to be a long, melancholy meditation on loss, impermanence and that noble, stubborn, foolish thing called love. We all know money can’t buy it, except sometimes, for the price of a plastic figurine or a movie ticket.

“Toy Story 3” is rated G (General audiences). Some of the mean toys might be a little scary, and the danger the nice toys face becomes pretty intense at times.

TOY STORY 3

Opens on Friday nationwide.

Directed by Lee Unkrich; written by Michael Arndt, based on a story by John Lasseter, Andrew Stanton and Mr. Unkrich; directors of photography, Jeremy Lasky and Kim White; edited by Ken Schretzmann; music by Randy Newman; production designer, Bob Pauley; produced by Darla K. Anderson; released by Walt Disney Pictures and Pixar Animation Studios. Running time: 1 hour 38 minutes. This film is rated G.