# Inverting material assignment on mesh

I am 3D modelling a museum for a game, and I wanted to give every painting a unique texture. On each painting there are 2 different materials: the frame and the painting. I selected each individual painting and assigned it a different painting material, leaving the frame material as the same.

However after changing every single painting material to an individual material, I realized that the parts of the mesh that the painting material and the frame material are assigned on were swapped (each is assigned to the other's). I can't do ctrl + l because all of the individual paintings are going to change. I really do not want to delete them all and then re-add them.

I tried in a duplicate of the project and I couldn't fully delete the 70 materials I made. Is there a way to change the assignment of each painting, while keeping them assigned to their different materials? I also added material utilities, and couldn't find a way, but there might be one.

Some screenshots:

import bpy