PDA

View Full Version : Reference Scripts?


Druie
10-06-2010, 06:23 AM
Hello,

Is anyone familiar if there is an existing script that allows me to select a target directory and have it reference every maya file inside that folder?

In the File Texture Manager script on Creative Crash it allows the user to target directories to allow users to repath textures! I was hoping there might be something similiar to this... I have an asset that is scanned into many different files and it's a pain to always have to reference each file one at a time...

Would be nice if I could tell it to march through a folder while I take a break!

Cheers,

Andrew

NaughtyNathan
10-06-2010, 10:39 AM
you could do this very easily with only a couple of lines of MEL. use the `getFileList` command to get your files, then iterate through them with a for..loop using the `file -r` command to reference them in. in fact, it's so simple here it is:

string $folder = "M:/work/naughty/projectX/models/";
string $files[] = `getFileList -folder $folder -filespec "*.m?"`;
// the *.m? wildcard lets getFileList grab ANY maya file (*.ma or *.mb) you could extend this even further...
for ($file in $files)
file -r ($folder+$file);

It could do with some additional functionality sure, and a UI where you browse for a folder would be good, but this is essentially all it requires.
:nathaN

Druie
10-06-2010, 01:47 PM
Thank you, Nathan! :D

CGTalk Moderation
10-06-2010, 01:47 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.