Message 1 of 2
Basic MEL programming problem

Not applicable
09-23-2012
11:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
My goal is this:
- manually create a cone and rotate it in X by 90, move it to Z by 1, and move the pivot point to the origin.
write a script to duplicate it 3 times, and rotate them 90 degrees, 180 degress and 270 degrees in Y
Heres the code I have to do that, the commented out part is just what it is trying to do.
For some reason, this only rotates like 1 or 2 of the cones and randomly. Does anyone see where my issue is?
- manually create a cone and rotate it in X by 90, move it to Z by 1, and move the pivot point to the origin.
write a script to duplicate it 3 times, and rotate them 90 degrees, 180 degress and 270 degrees in Y
Heres the code I have to do that, the commented out part is just what it is trying to do.
For some reason, this only rotates like 1 or 2 of the cones and randomly. Does anyone see where my issue is?
polyCone;
setAttr pCone1.rx 90;
setAttr pCone1.tz 1;
move 0 0 0 pCone1.scalePivot pCone1.rotatePivot;
/*
set for loop to run for 3 turns
duplicate cone
select it based on $count number
rotate it by $count *90 so count 1 - rotate it 90, count 2 - rotate is 180 count 3 - rotate it 270.
*/
for ($count = 1; $count < 5; $count++)
{
duplicate pCone1;
select ("pCone" + $count);
rotate -r 0 ($count * 90) 0;
};