Raptors general manager Masai Ujiri sat in the press room at Air Canada Centre minutes before tipoff Saturday night, dining on pasta and pizza.

Ujiri may as well have been dining on the Knicks’ carcass.

On a night Andrea Bargnani was a non-factor and benched in the fourth quarter and Carmelo Anthony was a bigger non-factor, home nursing a bum ankle, Ujiri’s Raptors busted up the Knicks, 115-100.

Ujiri’s club sent the hopeless Knicks careening into the new year with a 9-21 record, 12 games below .500, five games behind a first-place team trying to tank.

The home-and-home sweep to close 2013 certified that Ujiri’s pair of trades with the Knicks never looked better — two trades he made in two places that have wrecked owner James Dolan’s grand plan.

It was a vision with good intentions that started five years and one month ago, a plan that now can officially be deemed a colossal failure. Good intentions, bad execution by an owner willing to spend whatever is needed but never seems to realize his money is his most valuable asset as a basketball entrepreneur.

“We still have a long season,’’ Amar’e Stoudemire said in a desolate visitors’ locker room Saturday night.

Yeah, it will be a long season at the transformed Garden — The Mecca of Misery that closed shop for 2013 with its inhabitants at 4-12. Guess the Knicks players didn’t like that new bridge after all.

With a new year set to dawn, the Knicks only have to go 45-7 across the last 52 games to match last season’s 54-28 clip. That record will go down as the highlight of the old plan. That’s depressing, considering all it merited was a second-round berth and not the breaking of the championship curse as intended.

So when Dolan started looking for a fall guy for this debacle, he realized coach Mike Woodson was too easy a scapegoat. It’s not about him. It’s about five years of dizzying trades and moves Dolan oversaw, moves that amounted to J.R. Smith as the Knicks’ secondary star scorer.

Woodson is a good coach who has done a bad job this season after getting the club to overachieve in 2013. But that misses the big picture.

Eighty-one players — J.R.’s brother, Chris Smith, becoming the 81st — have played for the Knicks since the 2007-08 season. It is a mindboggling total.

So there was Dolan at Thursday’s practice, unable to fire himself, telling the players Woodson is safe and he doesn’t foresee making trades. Dolan can’t fire Glen Grunwald because he already did that — four days before the start of training camp. It was an unconventional move that may have angered the basketball gods and started this bad karma.

Five years ago last month, Nov. 21, 2008, Donnie Walsh broke up a 6-5 club, traded Zach Randolph and Jamal Crawford and set in motion a period that was supposed to land LeBron James and an All-Star sidekick with 2010 cap space. It instead landed a gimpy Stoudemire solo.

The second star came seven months later via the Anthony trade in which Ujiri, then with Denver, all but bank-robbed Dolan’s franchise of its depth, ultimately leaving Smith with too prominent a role.

The Knicks’ gift to Ujiri keeps on giving, even though the former Nuggets GM is now in another country, running another franchise. If the Knicks miss the playoffs, the Nuggets gain entry into the lottery for June’s superdraft with the Knicks’ pick.

Anthony turned into a fine All-Star player for the Knicks, not a superstar or leader who can carry a franchise on his back. It was fitting Anthony wasn’t in Toronto Saturday night, surprising his teammates had no idea when their ostensible leader might return.

“I have as much information as you,’’ Bargnani said, adding he was “hopeful’’ to have Anthony back for Thursday’s start of a dangerous three-game march through Texas.

Desperate again to find Anthony a more reliable scoring partner than Smith, Dolan and Ujiri dealt again in late June.

It was a desperate trade by a desperate owner trying to salvage his grand plan. The Knicks’ 2016 first-rounder that could have been used as a pawn elsewhere, or maybe even used by the Knicks, was sacrificed in a long-shot hope of resurrecting Bargnani’s career.

Bargnani has had his nice moments, but he hasn’t been what the Knicks needed him to be — a consistent, clutch, winning player with leadership skills and intangibles. That’s the opposite of what Bargnani is.

Dolan knew this might be coming, otherwise he wouldn’t have hired Steve Mills to begin “reprocessing’’ the franchise, gearing up for Anthony’s free agency and 2015 cap space. There’s a pipe dream about trading for 2015 free-agent point guard Rajon Rondo this summer, despite having no future assets, and then signing Kevin Love the following July. Trading for Rondo is as likely as landing LeBron James with the mini mid-level exception.

The year and the era is about over. What a disappointment.