So, I'm basically trying to create an array of all the shaders in a scene. I have this going so far, but was wondering how to put the looping bit into a separate proc, and have the appended array returned to the global procedure below. I've never been able to successfully setup something like this. Any help would be appreciated.
global procgetMeshes ()
{
string $shaders[];
string $additionalShaders[];
$additionalShaders = lsType "phong"
;
if (size $additionalShaders
> 1)
{
stringArrayRemoveAtIndex(((size $additionalShaders
) -1), $additionalShaders); // Removes the '' value in the last index.
appendStringArray ($shaders, $additionalShaders, (size $additionalShaders
));
clear $additionalShaders;
}
$additionalShaders = lsType "phongE"
;
if (size $additionalShaders
> 1)
{
stringArrayRemoveAtIndex(((size $additionalShaders
) -1), $additionalShaders);
appendStringArray ($shaders, $additionalShaders, (size $additionalShaders
));
clear $additionalShaders;
}
$additionalShaders = lsType "lambert"
;
if (size $additionalShaders
> 1)
{
stringArrayRemoveAtIndex(((size $additionalShaders
) -1), $additionalShaders);
appendStringArray ($shaders, $additionalShaders, (size $additionalShaders
));
clear $additionalShaders;
}
$additionalShaders = lsType "blinn"
;
if (size $additionalShaders
> 1)
{
stringArrayRemoveAtIndex(((size $additionalShaders
) -1), $additionalShaders);
appendStringArray ($shaders, $additionalShaders, (size $additionalShaders
));
clear $additionalShaders;
}
print ($shaders);
}
Separately... the insert code thingy for creating these threads never seems to work for me. Anyone else have this issue? It just pasts the html stuff into the thread, and not my code.