Okay, next issue!!! Cubes using this plane vert placement mode don't seem to want to place properly when using the code from the simple move x rand version. The cubes are all being placed in the correct amount, but ontop of each other and the script is failing at moving each cube as it gets created. Heres my code.. 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'll have to make a general procedure which in turn calls several other; global proc dragCommandProc(){ maxPinevalue(); maxMaplevalue();}global proc UI_Proc(){ // Some code intSliderGrp -label "Oak Percentage" -value 0 -fieldMinValue 0 -fieldMaxValue 100.0 -dragCommand "dragCommandProc()" -field true oak;} Alternative…
The easiest way to avoid overlapping is to do a distance check between the tree you're placing and all existing trees. If it's placed too close to another, remove it, or rather compare positions before placing the tree. Here's a code example on how to determine distance between two objects with vectors.// Get object…
I really recommend you read the error it gives. If you have code that gives you source errors, look for the specific part raising that error. If you have a runtime error it's recommended to add a print("--Some debug message begin--\n") and print("--Some debug message end--\n") in your code and place the prints so you can…
reply to post #1: maybe it'S smarter to randomly assign them to the vertices of your plane. check for dupes and you're fine. of course you might not get the denseness you like, but a helper mesh with more verts could do the job... there are a bunch of scripts on creativecrash.com who do exactly this(search for scatter..).…
I found the problem, it seems the programmers at Autodesk has been inconsistent regarding syntax for intSlider. Original:intSliderGrp -e -v Pine $maxPine; New:intSliderGrp -e -v $maxPine Pine; It is standard to set the value last, like with setAttr, but not with intSlider. The code below is a working example. //…
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…
So heres the code that I reworked to be more efficient in the long run. It should be easier to read and understand. Im gonna work through yours and comment it and hopefully you can look at what I have and see what I'm talking about. global proc gilesTreeGen() { if (`window -exists gilesTreeGen`) { // if Window exists…
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…