Thread: MEL headache!
View Single Post
# 3 03-12-2010 , 03:25 PM
happymat27's Avatar
Subscriber
Join Date: Jul 2004
Posts: 1,257
Hey Steve,

yeah all is good thanks... working hard etc.
what about yourself, still at the Uni?

So yeah MEL, or any other programming language, has never been my forte but I've got this script.....

// counting the CV's in the curve
string $curve = "waveCurveShape";
int $numSpans = `getAttr ( $curve + ".spans" )`;
int $degree = `getAttr ( $curve + ".degree" )`;
int $numCVs = $numSpans + $degree;
// this just lets me know how many there are
print $numCVs;

// a cluster for each CV
for ($i=0; $i<=($numCVs - 1); $i++)
{
select -r waveCurve.cv[$i];
newCluster " -envelope 1";
}

// rename and group clusters
for ($i=1; $i<($numCVs +1); $i++)
{
rename ("cluster" +$i +("Handle")) ("waveCluster" +$i);
}

//group clusters to neaten the outliner
for ($i=1; $i<($numCVs +1); $i++)
{
select -add ("waveCluster" +$i);
}
group; xform -os -piv 0 0 0;
rename group1 clusterGroup;


Create any curve and call it waveCurve and then execute the script, it will count the CV's and then create a cluster for each CV.
I can move the clusters one at a time to wherever I want using the CV count ($numCVs) for instance.....

// sets the location in x to the number of cluster -1
for ($i=1; $i<($numCVs +1); $i++)
{
float $c = ($i-1); select -r ("waveCluster" + $i);
move -rpr ($c) 0 0;
}


So waveCluster1 will be at 0,0,0 then waveCluster2 wil be at 1,0,0 etc.

I need the X value to follow the number pattern...

0,1,2,4,8,16,32,64,128.... etc for however many verts/clusters there are in the curve but my MEL-ness is not anywhere near that standard!!

Got any ideas?

Hope you're well,

Mat user added image


Click here to visit my site

Last edited by happymat27; 03-12-2010 at 03:28 PM.