View Full Version : MEL Place PolyPlane (and others)

02 February 2011, 12:19 PM

This should be rather simple, but I can't find this info *anywhere*

polyPlane -ch on -o on -w 0.15 -h 0.15 -sw 1 -sh 1 -cuv 2 ;
^This works to create a polyPlane. What if I want to create it at a specific location?
(I'm looping through hundreds of them and placing them at different locations)

With "circle" the flag is "-c". With Sphere the flag is "-p". I don't know why these are different flags, but neither of these work with polyPlane. Does anyone happen to know the voodoo? :)


02 February 2011, 03:22 PM
the poly primitives don't have a position creation flag which is why you can't find the info *anywhere*. :D

So basically, you can't create them at specific locations. You'll just have to move it once created e.g.:
move $x $y $z `polyPlane`;:nathaN

02 February 2011, 04:00 PM
Thanks heaps mate.. thats put an end to my wild goose chase :D

incase any internet archeologists stumble upon this thread, if you create the polyPlane with:
-name ("pPlane" + $i)

you can then move it with:
move $x $y $z ("pPlane" + $i);

Peace! :D

02 February 2011, 07:16 PM
this is actually not a good practice Lachlan, you can never guarentee the name Maya will give a node, even if you specify it directly like this. Consider that there may already be a node in your scene called "pPlane1" when you run that code, you will move that node and not the one you just created.
Always capture your node names (like I did in the earlier example) although by all means still give them a name if you want. e.g:
for ($i=1 ; $i<=10 ; $i++) // create 10 new planes
string $newPlane[] = `polyPlane -name ("myPlane"+$i) -ch on -o on -w 0.15 -h 0.15 -sw 1 -sh 1 -cuv 2`; // returns TWO items (transform/shape)
// now refer to it by variable name, not it's assumed explicit name:
move $x $y $z $newPlane[0]; // transform!

CGTalk Moderation
02 February 2011, 07:16 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.