Hi,
i want to break texture and shader connections through MEL,
but the problem with layeredShaders and normal Shaders(blinn,lambert etc...)
How to make the condition here to break both the shaders at a time.
This is my script now it breaks LayeredShaders,but problem with normal shader nodes.
global proc breakTexConnections()
{
string $selList[] = ls -mat
;
string $selTex[] = ls -tex
;
string $lShader[] = ls -typ "layeredShader"
;
for( $i=0; $i<size( $selList ); $i++ )
{
catch(connectionInfo -id ($lShader[$i] +".inputs[0]" + ".color" )
);
string $breakInfo = connectionInfo -sourceFromDestination ( $lShader[$i] +".inputs[0]" + ".color" )
;
catch ( disconnectAttr $breakInfo ( $lShader[$i] +".inputs[0]" + ".color" )
);
setAttr ($lShader[$i] +".inputs[0]" + ".color") -type double3 1 1 1 ;
}
if( connectionInfo -id ( $selList[$i] + ".color" )
)
{
string $breakInfo = connectionInfo -sourceFromDestination ( $selList[$i] + ".color" )
;
catch ( disconnectAttr $breakInfo ( $selList[$i]+".color" )
);
setAttr ($selList[$i]+".color") -type double3 1 1 1;
setAttr "layeredShader1.inputs[0].color" -type double3 1 1 1 ;
}
}
Thanks.