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…
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…
Variables only exist within the same scope. Two procedures are two different scopes. Even if you made global variables this wouldn't work because the UI script will only run "once", which is the reason why you have commands like dragCommand so you can dynamically update the UI. In your intSlider definition you can only set…
@illusions, i'm not sure how that would work though? I need there to be three different percentages to control three different types of tree surely? @fade1, the script is required to work without a floor plane (just blank maya scene) and then i'd like to make it work with a floor plane too. Maybe it would be possible for…
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..).…
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…
Ah right, yes i do remember my teacher saying something about that issue with maya :/ Here's the script thus far: global string $Density; global string $Area; global string $placementHelper; //main window window -title "Giles Tree Gen V 0.1" -iconName "Tree Gen" -widthHeight 300 300; columnLayout -adjustableColumn true;…
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…
My script works by using vertex positions from the plane, so i was asking if there was a way to find out which vertex positions have been used from the plane already?
ideally id like to squeeze the selected number of trees into the coordinates. That way the user gets the number of trees they have selected. What would be best of going about this. I was thinking one way would be to set the grid as the boundary that way all the user would do is set the grid the size they want and then run…