SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 03-12-2010, 11:42 AM   #1
happymat27
Subscriber
 
happymat27's Avatar
 
Join Date: Jul 2004
Posts: 1,257
Default MEL headache!!

Hi,

it's been an age since I've posted up here but I need a little help with MEL and I figured that this would be the place to ask.

So...

Imagine a curve with an unknown number of CV's, I have made a script to count the CV's and attach a cluster to each one. I now need to distribute the clusters along the X axis using 0.005 as a base and the sequence 1,2,4,8,16,32,64....etc as the multiplier.

So the first cluster would be at 0.005, the second at 0.010, the third at 0.020, the fourth at 0.040 and so on.

has anyone got an idea how I could achieve this with MEL?

Cheers,

Mat
__________________
Click here to visit my site
happymat27 is offline   Reply With Quote
Old 03-12-2010, 04:41 PM   #2
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Default

You are essentially just doubling the X value so a simple for loop should do. Something like this

Code:
int $i;
float $x = 0.005;
for($i = 0; $i < $numberOfCVs; $i++)
{
	$x *= 2;
	// Do whatever needs to be done
}
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
MEL headache! happymat27 Members Lounge 5 05-12-2010 09:43 AM