# connect shader to SG
shaderOutput = 'outValue'
if shaderType== 'mia_material' or shaderType == 'mia_material_x':
if shaderType == 'mia_material_x':
shaderOutput = "result";
pm.connectAttr('%s.%s' %(name,shaderOutput), '%s.miMaterialShader' %(sg), force=True)
pm.connectAttr('%s.%s' %(name,shaderOutput), '%s.miShadowShader' %(sg), force=True)
pm.connectAttr('%s.%s' %(name,shaderOutput), '%s.miPhotonShader' %(sg), force=True)
else:
pm.connectAttr('%s.outColor' %(name), '%s.surfaceShader' %(sg), force=True)
pm.setAttr('%s.weight1' %(name),0.85)
pm.setAttr('%s.roughness1' %(name),0)
pm.connectAttr('ramp1.outColor', '%s.metallic1' %(name), f=True)
return [name, sg]
This is the error I'm getting "# RuntimeError: The source attribute 'ramp1.outColor' cannot be found"