mel command to freeze transformations

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  07 July 2003
mel command to snap to curve

Regards all,
I am working on a mel script to generate a row of pikes (spears) in a castle scene. I would like the script to constrain the pikes to a curve as it duplicates them so the user can draw the curve then execute the script and the pikes are generated along that path. I am at a loss tho. Here is what I have so far, any suggestions on how to achive what i am looking for?



// ss_pikes.mel //
// scott spencer //
// 7/27/03 //
// //
// generates a row of pikes and tilts them in x and y //

//declare variables for the rotate x and y values

int $pike_count = 0;

//create cone
polyCone -r 1 -h 2 -sx 3 -sy 1 -sz 0 -ax 0 1 0 -tx 1 -ch 1;

//scale into shape of pike
scale -r .088 10.001 .076;

//move pivot to base of pike
xform -ws -piv 0 -10 0;

//move pike to groundplane
move -rpr -y 0;
seed (1);
do {

float $rotx = `rand 0 78`;
float $roty = `rand -30 30`;
float $trans = `rand .5`;

//duplicate with random xy transform
duplicate -rr; move -r 1;

//get selected objects tx value and add it to the tx of the next
//pike generated

//rotate in the x and y axes to tilt forward and to side
rotate -ws $rotx $roty 0;

//add one to $pike_count
$pike_count ++;


while ($pike_count < 100);
Scott Spencer

Last edited by doppelganger : 07 July 2003 at 12:28 AM.
  01 January 2006
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 05:37 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.