i want to name my objects in scene with name of theirs materials if i try this, it works fine:
import maya.cmds as cmds allMat = cmds.ls(mat=True) for mat in