  | | | Novice at MEL | Novice at MEL 2003-11-26 - By Dobson, Jeff
Back Here is an commented example of a procedure I use in one of my scripts to build a listbox from the contents of a particular directory. I hope it helps.
proc msb_buildListbox () //Builds my effects listbox from contents of a directory { //I need to use these globals global string $SOE_EFFECTPATH; //Put my files into an array string $effectList[] = sort(`getFileList -fld $SOE_EFFECTPATH -fs "*.eft"`); //Begin building textScrollList command for eval later string $appendList = "textScrollList"; //Loop on contents of my directory and append each onto my command for ($effect in $effectList) { $appendList = $appendList + " -a \"" + $effect + "\""; } //Finish off command with other flags $appendList = $appendList + " -sc \"msb_getEffectInfo\" effectListbox"; //DEBUG - this is here so I can check that the command gets created properly print ($appendList +"\n"); //Eval the command to create the actual control eval ($appendList);
} //end msb_buildListBox
--JeffD
-- --Original Message-- -- From: David Mart�nez Carrasco [mailto:david@(protected)] Sent: Tuesday, November 25, 2003 9:07 PM To: maya-dev@(protected) Subject: Novice at MEL
Hi, I�m a student of Alias Maya and I just started with MEL Scripting.
I have a question about how can i do some things... but one is making me specially crazy!
I have a "textScrollList" and i don�t wanna to put flags manually. Before to enter to the definition of this control, i define a string and I assign the text of the flag like this: --- string $texto = "-append \"1a\" -append \"1b\" -append \"1c\""; ---
So later, i dunno how to put inside of the control. I tried this but script editor says me that the flag is invalid (I have a layout and a window but I will don�t show the code here):
--- textScrollList -numberOfRows 8 -allowMultiSelection true -p estBaseVentana ($texto); ---
My question is... how can i put this string and not recibe an error ? I tried to put the same text manually and it works perfectly. I need this because i will make a "while" to determine all the elements to put on this list.
The other question is how can i do a loop like a "While" inside a control ? it�s making me crazy! The control thinks that i�m putting flags and always give me error
any help will be appreciated
Sorry for my english, it�s a little difficult for me. Hope u understand me! :P
--- David Mart�nez Carrasco - Thorse E-Mail: david@(protected) Temporal Gallery: http://thorse3d.tripod.com/ ---
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- List-help: <mailto:listar@(protected)?Subject=help> List-archive: <http://www.highend3d.com/maya/devarchive/>
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- List-help: <mailto:listar@(protected)?Subject=help> List-archive: <http://www.highend3d.com/maya/devarchive/>
|
|
 |