Using Python to re organize textures in materials

Doing a tedious work where I look at thousands of materials in UE to see how the textures are used currently and if wrong, I break the texture in to channels assembly it to a proper ORM texture out of it which I then place back in to the material. Thinking of using Python to automate the thing, but get a bit stuck on reading the channels currently used in the material. Trying with the “MaterialEditingLibrary” and some help from @isaacoster videos… but can’t get the dots connected fully. Also looked into TAPython, which could help a bit. Anyone that has more clues on where I can search for examples around material editing in Python?

@JoakimTornhill hi sorry for the delay, did you get this figured out?

Yes, managed to get everything as I wanted. With the help of TAPython I managed to recursively follow every node back to see how the different channels on each image was used. Thanks for follow up :).