Carmelo Anthony played most of the season with a partial tear of the left patellar tendon, The Post has learned.

In new details, the debridement part of Thursday’s surgery was to clean out the calcium deposits that formed within the partial tear, so the tear could be repaired.

If Anthony had suffered a full tear of the patellar tendon — also known as a rupture — he could not have played on it this season. Ex-Knick Antonio McDyess suffered a full tear in 2000, as did the Giants’ Victor Cruz last season.

Knicks president Phil Jackson gave a likely four-to-six month timetable for Anthony, meaning he won’t be permitted to participate in contact scrimmages until somewhere in that window.

In the best-case scenario, Anthony will be scrimmaging in late June and will have his full summer training program uninterrupted. If he’s out six months, Anthony wouldn’t scrimmage until around mid-August. Training camp begins around Oct. 1.

Anthony will be reevaluated after eight weeks and could be cleared to do light work on the court then. The issue of his timetable arose because Anthony said two weeks ago the rehab was eight weeks, not four-to-six months.

Anthony is on crutches and hasn’t talked to the media since the procedure.

Jackson had declined to specify what the knee injury was. The Knicks announced in a release Anthony would have “a left-knee patella tendon debridement and repair.’’ The release made no mention of a tear.

Anthony played 30 minutes on his partially torn tendon in the All-Star Game, his last appearance of the season, and has said it has bothered him since the second game of the season.

Had the surgery just been a debridement, an eight-week rehab would’ve been in place.