Hei all, I have this procedural program that creates different object in Maya through Python. After the creation of these elements I want to get the user the possibility to select some of these object and though a button to delete it...The problem is that I don't understand how to get the name of the object... So far my code is this..
#Deletes Selected Element selected from the user
def DeleteSelection(*args):
selected = cmds.ls(sl=1,sn=True)
print(selected)
#if(cmds.objExists()):
#cmds.delete(selected)
#
And in the GUI I have this button...
cmds.button(label='Delete Selection', w=150,h=30,command=DeleteSelection)