Hello, This is my first post
I'm working on a project, I want to make a dynamically generated User Interface based on the types of nodes in a scene. The following portion of code:
[codebox]global proc typeList()
{
string $objectsTEST[] =ls
;
string $allTypesInSceneTEST[];
int $a;
$numObjectsTEST = size($objectsTEST)
;
string $entireTypeListTEST[];
for ($i =0; $i < $numObjectsTEST; $i++)
{
$entireTypeListTEST[$i] = objectType $objectsTEST[$i]
;
}
int $entireTypeListSizeTEST = size($entireTypeListTEST)
;
//$allTypesInSceneTEST[0] = "Initial Value";
for($i=0;$i < $entireTypeListSizeTEST; $i++)
{
if ($entireTypeListTEST[$i] == $entireTypeListTEST[$i+1] )
{
print $entireTypeListTEST[$i];
}else{
int $a = eval(size ($allTypesInSceneTEST));
$allTypesInSceneTEST[$a-1] = $entireTypeListTEST[$i];
print $allTypesInSceneTEST[$i];
}
print $allTypesInSceneTEST;
}
}[/codebox]
is supposed to query every object, determine it's type and create a list. Once i have this list im gonna feed it through a loop that will create the UI elements. The problem is that the code i have right now does not work and Maya's error:
typeList();
// Error: //
// Error: Line 0.1: Syntax error //
isn't quite helping me find the issue.
if there is an easier way to do this I'm all ears. I'm new to all this so this is the only way I could think of doing it.