[Python][Maya] Delete components

polycounter lvl 4
Offline / Send Message
Pinned
Justo polycounter lvl 4
Hi guys, I was making a script that´d delete components replicating Max's behaviour, like when you hit delete on a vertex\edge, it´ll convert that selection to face mode and then delete it.

cmds.select(cmds.polyListComponentConversion(tf = True))

faces = cmds.filterExpand(sm=34)

if cmds.filterExpand(sm=34):

			cmds.polyDelFacet(faces)


It works! But now I wanted to add a clause or something that´d say "If there are no components selected...just use the regular delete command" or sth like that. (like for deleting objects, or any other type of element that are not vertex/edge/faces).

Does anyone now a simple manner to do this?

Replies

Sign In or Register to comment.