convert imported materials to PBR using a script possible?

Hi, a small question: Is it possible to convert / assign materials using a script?

For instance: I import meshes with multi-sub-materials ‘glass’, ‘white_wood’, etc. Instead of the basic imported materials I like to automatically assign PBR materials ‘M_glass’ and ‘M_white_wood’ that are already in the project. If possible I would also like to assign lightmap channel 1 and a custom resolution to it as well.

Can this be done using blueprints of is there a better way?

regards, Max