Replace path prefix with predefined words
I have a bunch of fileservers of different locations which can be accessed over internet \\f1 \\f2 \\f3 (all of them are mirrored folderstructure). I want to repath all of them to a drive instead of a network path when I run a maxscript. As it takes a huge amount of data to read all textures over the vpn network.
Lets say I have textures in this folder \\f1\resources\textures and want to replace the prefix \\f1\resources\ to A:\ like this
oldPrefix1 = “\\f1\resources\, \\f2\resources\, \\f3\resources\”
newPrefix1 = “A:\”
oldPrefix2 = “\\f1\projects\, \\f2\projects\, \\f3\projects\”
newPrefix2 = “B:\”
etc
Is this possible with an easy ATSOps script (tried but couldnt get it to work) or any other kind of script? We usually do the same operation but with Interactive renamer or relink bitmaps but its allways the same path that needs to be replaced so I would be easier to have one script the replaces the "prefix" of the full path every time
Comments
Use substituteString
A prettier way would be to use RegEx...
Thank you, I missed that
Thank you, I missed that somebody had commented on this thread :/.
I replaced all "\\\\" to our network config to our network configuration and run the function but the only thing that happens is that it prints the new_prefix in the max script listener but the texture itself in this case doesn't rename the prefix to the new path.
A:\
A:\
A:\
I tried to add the follow ATSOps before and after to retarget the prefix on one textures but it only ends up changing the full texture name into A:\ instead of ex A:\textures\eye.jpg