I'm working with a render farm at school, and one of the things it requires is that all the file textures in a maya scene be set to a relative path instead of an absolute one. I'm trying to work up a little MEL script that will do that for me, so I'm not going through scenes and re-naming dozens of file paths...but I can't get it to work correctly.
Here's what I have so far:
global proc string filepart( string $path )
string $filepart = match( "[^/\\]*$", $path );
string $fullpath = `getAttr file1.fileTextureName`;
string $file = filepart( $fullpath );
setAttr -type "string" file1.fileTextureName ("sourceimages/" + $file);
I think the problem lies somewhere in the $path variable. If I change the setAttr string to just text, for instance if I specifically type in the file path name (e.g. "sourceimages/file1.jpg") it changes the name just fine. But once I have the ("sourceimages/" + $file) it craps out on me. Anyone know what I'm doing wrong here?