Hm, I dont get it to work...
Could you give an example?
I found this pymel example, but could not get it to work either:
`import maya.cmds as cmds
import pymel.core as pm
sel = cmds.ls(sl=True)
selectedShapes = pm.listRelatives(sel , ad=True, type=["mesh", "nurbsSurface"])
for shape in selectedShapes:
shadingEngines = shadingGroup = shape.outputs(type="shadingEngine")
for shadingEngine in shadingEngines:
#surfaceShader = shadingEngine.surfaceShader
surfaceShader = cmds.getAttr(shadingEngine + ".surfaceShader")
print surfaceShader
if surfaceShader.type() == "lambert":
print("lambert")
if surfaceShader.type() == "surfaceShader":
print("surfaceShader")
else:
print("nope")`