Now, i'm currently putting this kick-ass MEL together that changes the standard Maya toolbox into something useful and pretty darn big. It's going to contain all the MEL commands we know and love, but not as seperate MELs, instead replacing the standard toolbox with everything intergrated to it.
Now, i'm not going to say why, but trust me, there is an idea behind doing this. I want to not have the tool procedures to be contained within the main MEL, nor have them all in one MEL. I need all tool scripts to be in their own seperate MEL file under a sub-folder. So that ONE tool is in ONE MEL, and all of these tool MELs are in the procedures folder (the procedures folder is a part of my mapping of this MEL application).
I've managed to get Maya to gather a filelist of all the MELs contained in the procedures folder and put it into an string array, BUT just HOW do i get Maya to source these arrays?
I've tried some different loops, but i can't get loops to work with the source command (i might be doing something wrong, haven't used loops all that much before).
Here is the code that will give you the string array of files contained in a specific folder,
i hope someone can tell me how to finished this section of my MEL application. The folder is fictional, you'll have to create that folder referenced in the string for it to work (that would be "../maya/x.x/scripts/myMEL", the "myMEL" folder doesn't exist by default, create it, put some MEL files in it and run the script)
string $userScriptDir = `internalVar -userScriptDir`; // string of path to script folder
string $melAppDir = $userScriptDir + "myMEL/"; // string of path to ../scripts/myMEL
string $melFileList = `getFileList -folder $melAppDir -filespec "*.mel"`; // get a list of files from specified folder (myMEL folder)
// just to check the code above, if i didn't mess up rewriting the code for this post,
// it should print an array of the mel files in the folder
as i said, this will only get a file list, but i need Maya to source these and NOT by writing each MEL file into the script, but having this file list be sourced automatically sourcing all the MEL files in the specified folder.
thanks in advance to those that put their heads into this and help getting this MEL application finished!