Some notes about Maya and MEL. Like haiddasalami mentioned global proc means you can call the procedures directly but you do not get direct access to variables inside it. The variables will stay in their scope. If you define a variable in the MEL window those variables will become globals for the session. I noticed a nasty…
Yeah whats happening is that its declared in the memory and wont get cleared till you restart maya. Definitely annoying and one of the reasons I hate Mel :D yeah and globals are definitely not the way to go especially i find with Mel. Mind posting the whole script so I can throw some edits/pointers?
dragCommand is the command that should be invoked when you drag the slider, just like it says. Oh, by the way, regarding names in MEL. If you type a word without quotation marks in certain contexts Maya will assume it's an object in the scene or a name. For example; select -r SomeObject; intSlider -min -100 -max 100 -v 0…
I might be way off here (it's been a while since I've been elbow-deep in MEL, as it were), but does referring to a control in that way actually work? int $oakPercent = `intSliderGrp -q -value oak`; Here, you're querying an intSliderGrp and expecting the name "oak" to work. Where is it getting that value from? It's not a…
you could just store the vertex positions that you have used something like //OUTSIDE OF FOR LOOP//float $vertexList[];//Inside FOR LOOP//$vertexList[size($vertexList)] = pPlane1.vtx[$randomNumber1]; Sucks that mel doesnt have push/pop or any array methods so this is a quick way to do a push. PS: I havent tested this, so…
Right, straight away another issue haha. Google has no answer for this one either (lack of basic MEL stuff on the web is annoying). int $randomNumber1 = `rand $vertexCount[]`; print $randomNumber1; What i want to do here is take the vertex count and make it as the highest value the Rand can use (because obviously you don't…
well making it global doesnt make everything inside global. The global is there so you can call functions through the script editor. For something like that you need to look into arguments where you're basically passing data back and forth or doing setters and getters (cant remember if mel even supports it) Not sure where…
For my university assignment i have to make a script that scatters tree's across a scene randomly. The script has to include: · "Simple User Interface (GUI) to include the following options: [FONT="]o [/FONT]Select species of tree to use – i.e. Oak / Beech / Pine etc [FONT="]o [/FONT]Number of trees to generate…
You're most likely only running that code once so it will only happen on first execution. I see a couple of errors, first you're using a float field max value while calling on an intSlider. If you're okay with integers then it doesn't matter, MEL is forgiving when converting some datatypes. Secondly you need to add a…
Hey there im in the same class as Giles and doing the same project. I am a total novice when it comes to Mel. I was hoping maybe you guys could answer one or two questions i'm having. I'm going about this in a different manner to Giles and trying to keep it super simple. So far i have a script that generates randomly…