yogeshsherman
10-29-2010, 02:00 PM
actually I want to do this thing in mel
if my statement set true "3" then that third statement should run to maya memory (source it) , so that i can use this this array in for loop but maya don't take it in it's memory but if i put simple command in, "if else" function like sphere or polcube then maya source this thing so any of you guys know any way with which i can source(store) this variable with my control. Following is the code i have written so far and it is not working the way I wan't it to be.
int $numbers=3;
if ($numbers==3)
{
string $numbers[] = {"red", "green","blue"};
}
else if ($numbers==2)
{
string $numbers[] = {"red", "green",};
}
else if ($numbers==1)
{
string $numbers[] = {"red"};
}
else
{
string $numbers[] = {"red", "green","blue","yellow};
}
if my statement set true "3" then that third statement should run to maya memory (source it) , so that i can use this this array in for loop but maya don't take it in it's memory but if i put simple command in, "if else" function like sphere or polcube then maya source this thing so any of you guys know any way with which i can source(store) this variable with my control. Following is the code i have written so far and it is not working the way I wan't it to be.
int $numbers=3;
if ($numbers==3)
{
string $numbers[] = {"red", "green","blue"};
}
else if ($numbers==2)
{
string $numbers[] = {"red", "green",};
}
else if ($numbers==1)
{
string $numbers[] = {"red"};
}
else
{
string $numbers[] = {"red", "green","blue","yellow};
}
