在CreativeCrash上有一个旧线程处理此问题。我在那里展示的脚本如下(请参阅原始线程了解更多信息):proc connectAndSet(string $original, string $target){
$conn = `connectionInfo -sfd $original`;
if ($conn != ""){
connectAttr -force $conn $target;
} else {
connectAttr -force $original $target;
disconnectAttr $original $target;
}
}
proc convertPhongToMia(string $original){
$target = `mrCreateCustomNode -asShader "" mia_material_x`;
connectAndSet($original + ".color", $target + ".diffuse");
// ... any other mapping you need comes here...
// a bit weak test should work for simple materials,
// not used in special context
$sg = `connectionInfo -dfs ($target + ".message")`;
$sgr = `match "[^.]*" ((string)$sg[0])`;
$sg0 = `connectionInfo -dfs ($original + ".outColor")`;
$sgr0=`match "[^.]*" ((string)$sg0[0])`;
sets -e -forceElement $sgr `sets -q $sgr0`;
delete $original;
rename $sgr $sgr0;
rename $target $original;
}
for ($item in `ls -et phong`)
convertPhongToMia($item);
你应该可以根据自己的需要重新使用它。在