PDA

View Full Version : Turning a shape into another through connections


realmISR
10-05-2006, 01:43 AM
Hey guys, I have a problem here and would be grateful if anyone could give insights.

I'm supposed to have 4 shapes, let's say A B C and D. Then create a MEL script that can cycle the connection between the 4 shapes so that each time I execute the script:

shape B will become shape A
shape C will become shape B
shape D will become shape C
shape A will become shape D

Now this is just 1 execution, when I execute the script again, the cycle should continue on. I hope I haven't lost you yet, I think it's supposed to be fairly easy, it's just that I do not have the knowledge yet since I started learning MEL 2 weeks ago.

How would i cycle the connection of the 4 shapes (turning one into another) with MEL?
Thanks in advance.

P.S: I believe I'm supposed to do this with "strings" but I have no knowledge of this matter yet, it'd be great if someone can enlighten me.

westiemad
10-05-2006, 03:58 PM
a string is a word (or character);

string $mypet = "cat";

One way to do this is this if statements. (or case statements if u want to try those).

if(myCurrentShape == shapeB)
changeMyShapeto shapeA
else if(myCurrentShape == shapeC)
changeMyShapeTo shapeB
else
print "oops at the end";
etc etc.

the == means a equality test, so 5 == 5, or polyPlane1 == polyPlane1 etc would be true because both the values are the same. The if statement will only execute when the thing in the brackets is true, eg polyPlane1 == polyPlane1, otherwise it'll go to the else if, then the next, then final else.

CGTalk Moderation
10-05-2006, 03:58 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.