mzee
01-30-2007, 09:00 PM
Hi!
I'm working on a script which creates 2 Bins which contains used and unused shader.
so far so good.
The script is working fine as long as i don't pipe e.g. a DGS-Shader through a surface-shader.
The script is checking if the shader is assign or not.
In this case the DGS-Shader isn't directly assign so the DGS-Shader is added to the unusedshader bin.
Here's a part of the script
**********************************************
{
string $userinput = `textFieldGrp -q -text hh_extension`;
if (size($userinput) == 0)
{
confirmDialog -m "Please fill in a Sets-Extension-Name!!!" -b "OK" -db "OK"; // do nothing
}
else
{
string $hh_selection[] = select (`ls -mat`);
string $hh_matname[] = `ls -selection`;
//For loop
for ($i = 0; $i < size($hh_matname); $i++)
{
hyperShade -objects $hh_matname[$i];
if (size(`ls -sl`) != 0)
{
pickWalk -d up;
sets -name ($userinput + "_" + $hh_matname[$i]);
select $hh_matname[$i];
select -noExpand `listHistory`;
binMembership -add $userinput;
select -cl ;
}
else
{
select $hh_matname[$i];
binMembership -add UNUSEDSHADER;
select -cl;
}}
}
**********************************************
select -noExpand `listHistory`; with this command the whole shading network is added to the used shader bin.
What worries me is the following:
else
{
select $hh_matname[$i];
binMembership -add UNUSEDSHADER;
select -cl;
}}
Here lies the problem - but i have no idea how i can fix this. All shaders that are not directly assign to an object will be added to unusedshader bin even if they are piped through a surfaceshader.
In this case i got not directly assigned shaders in both bins the usedshader bin and the unusedshader bin.
I really appreciate your help
I'm working on a script which creates 2 Bins which contains used and unused shader.
so far so good.
The script is working fine as long as i don't pipe e.g. a DGS-Shader through a surface-shader.
The script is checking if the shader is assign or not.
In this case the DGS-Shader isn't directly assign so the DGS-Shader is added to the unusedshader bin.
Here's a part of the script
**********************************************
{
string $userinput = `textFieldGrp -q -text hh_extension`;
if (size($userinput) == 0)
{
confirmDialog -m "Please fill in a Sets-Extension-Name!!!" -b "OK" -db "OK"; // do nothing
}
else
{
string $hh_selection[] = select (`ls -mat`);
string $hh_matname[] = `ls -selection`;
//For loop
for ($i = 0; $i < size($hh_matname); $i++)
{
hyperShade -objects $hh_matname[$i];
if (size(`ls -sl`) != 0)
{
pickWalk -d up;
sets -name ($userinput + "_" + $hh_matname[$i]);
select $hh_matname[$i];
select -noExpand `listHistory`;
binMembership -add $userinput;
select -cl ;
}
else
{
select $hh_matname[$i];
binMembership -add UNUSEDSHADER;
select -cl;
}}
}
**********************************************
select -noExpand `listHistory`; with this command the whole shading network is added to the used shader bin.
What worries me is the following:
else
{
select $hh_matname[$i];
binMembership -add UNUSEDSHADER;
select -cl;
}}
Here lies the problem - but i have no idea how i can fix this. All shaders that are not directly assign to an object will be added to unusedshader bin even if they are piped through a surfaceshader.
In this case i got not directly assigned shaders in both bins the usedshader bin and the unusedshader bin.
I really appreciate your help
