How to Change the Default Material in Maya

Опубликовано: 02 Май 2026
на канале: malcolm341
16,723
195

Click here to subscribe https://www.youtube.com/malcolm341?su...

To support me go here https://gumroad.com/malcolm341

Learn how to change the default material to Blinn or StandardSurface in Autodesk Maya.

//*******************************************************************************************
//The code for Default Blinn Shader
global proc m341_defaultBlinn()
{
string $allMats[] = `ls -mat`;
int $switch = 1;
for ($item in $allMats)
{
if (`gmatch $item "blinn1"`)
{
$switch = 0;
print "blinn1 already exists";
break;
}
}

if ($switch == 1)
{
shadingNode -asShader blinn;
string $defaultBlinn[] = `ls -sl`;
connectAttr -f ($defaultBlinn[0] + ".outColor") initialShadingGroup.surfaceShader;
}
}
scriptJob -compressUndo 1 -runOnce 0 -event "SceneOpened" "m341_defaultBlinn";


//*******************************************************************************************
//The code for Default Phong Shader
global proc m341_defaultPhong()
{
string $allMats[] = `ls -mat`;
int $switch = 1;
for ($item in $allMats)
{
if (`gmatch $item "phong1"`)
{
$switch = 0;
print "phong1 already exists\n";
break;
}
}

if ($switch == 1)
{
shadingNode -asShader phong;
string $defaultPhong[] = `ls -sl`;
setAttr "phong1.cosinePower" 20;
connectAttr -f ($defaultPhong[0] + ".outColor") initialShadingGroup.surfaceShader;
}
}
scriptJob -compressUndo 1 -runOnce 0 -event "SceneOpened" "m341_defaultPhong";


//*******************************************************************************************
//The code for Default Standard Shader
globla proc m341_defaultStandard()
{
connectAttr -f standardSurface1.outColor initialShadingGroup.surfaceShader;
}
scriptJob -compressUndo 1 -runOnce 0 -event "SceneOpened" "m341_defaultStandard";