There's a lot that goes on when you do that
look up
whatIs AEshaderTypeCB;
AEshaderTypeNew.mel is where all the procs are defined that handle this;
a bit of copy and past ought to be enough though,
the example shows how to turn blinn3 into a lambert.
proc disconnectMaterialInfo( string $shaderNode,
string $newShaderNode )
{
$materialInfoNode = getMaterialInfo($shaderNode);
if ($materialInfoNode == "")
{
// The materialInfoNode doesn't exist... fail silently.
return;
}
disconnectAttr ($shaderNode+".message") ($materialInfoNode+".material");
}
proc string getMaterialInfo( string $shaderNode )
{
string $connections[] = listConnections ($shaderNode+".message");
for ($item in $connections)
if (objectType $item == "materialInfo")
return $item;
return "";
}
string $shaderNode = "blinn3";
string $replaceNode = createNode lambert;
disconnectMaterialInfo($shaderNode, $replaceNode);
replaceNode $shaderNode $replaceNode;