Okay so the reason is pointPosition is giving 3 values but vertex list will only take one value (float). So we just change the data type to vector and all is good :) float $vertexList[] to vector $vertexList[]
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…
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…
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…
Thanks for the help so far guys. Ok so i still have;nt manage to figure out the overlapping i am about as useful as a bag of hammers when it comes to Mel. I have a new question either way, i want to create a boundry which is adjustable using two intSLiderGrp. So say a limit on the x and z axis which the user dictates. Then…
Edit* haiddasalami beat me to it. :) gilesruscoe >> This line is wrong: $vertexList[size($vertexList)] = `pointPosition pPlane1.vtx[$randomNumber1]`; You're trying to store a position to a float array. In this case you would want a vector array or remember the vertices by index. mccartm6 >> It's absolutely doable but it…
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…
K so the reason is you're first missing the open and close brackets for the for loop. Second the move command wants the object name at the end. Otherwise the script will just error out. Here's the fixed up code: for( $i=0; $i<$density; $i++ ) { string $tree[] = `polyCube -name ("treeA"+$i)`; int $randomNumber1 = `rand…
Ah right, so you have to store the coords in a float array and then seperately call out each number stored in it. Gotcha! Thanks a ton for the working code. That part works now. While i was having trouble with that i started on the percentage sliders. I'm having trouble getting this to work: intSliderGrp -label "Oak…