Quick MEL script to quickly re-connect existing texture connections from one slot to another within multiple materials. To use, alter the script to determine the attributes to connect/disconnect, then select multiples materials and run the script.

As defaults, the script is set to get the first input node it can find, its outColor attribute, re-connect it to the material’s ambientColor attribute. Then, it disconnects that input node’s outColor attribute from the material’s color attribute.

It should work, but it’s admittedly a very sketchy script. Well, until I find time to improve it. Cheers!

global proc rf_reconnect(){
    string $sel[] = `ls -sl`;
    for ($item in $sel) {
        string $srccon[] = `listConnections -s 1 -d 0 $item`;
        connectAttr -f ($srccon[0] + ".outColor") ($item + ".ambientColor"); //Create New Connection
        disconnectAttr ($srccon[0] + ".outColor") ($item + ".color"); //Remove Old Connection