PDA

View Full Version : Basic array question


johnchuang
02-13-2008, 09:33 AM
Hi, everyone. I'm new to mel . I want to store a sequence of couple variables( "a1" , "a2" ;"b1" , "b2"; ect...) using array. Is there a Array type array? Or should I use matrix? And how can I store those variables in matrix without knowing the precise number of them?
Any help ? Thanks in advance!

T1ckL35
02-13-2008, 10:14 AM
Single dimensional arrays:
string $myStrArray[] = {"a1", "a2", "a3"};

Mel doesnt appear to use multidimensional arrays except for the set length Matrix type. Not ideal but you can get around it like in the example here:
http://books.google.com/books?id=tEkz7jCcZF4C&pg=PA74&lpg=PA74&dq=maya+mel+multi+dimensional+array&source=web&ots=Igd4CxA_33&sig=KL899oEnYxkz98ra2rsiVVuVCU4
Thats why I use Python for such tasks ;)

Simon

johnchuang
02-13-2008, 02:11 PM
Hi,Simon. Thank you very much! I'll try to learn Python when I'm a little bit better in using mel. Thank you!

CGTalk Moderation
02-13-2008, 02:11 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.