select command

select command

Anonymous
Not applicable
2,727 Views
3 Replies
Message 1 of 4

select command

Anonymous
Not applicable

hey guys sorry for asking this silly question but new to python,so i wrote this particular command to select all the constraints whosoever is in the scene and then delete all constraints.so i wrote this.

 

import maya.cmds as mc

 

sel = mc.ls(sl=True,type="constraint*")
for all in sel:
mc.select(all)

mc.delete()

 

please help don't know what to do

0 Likes
Accepted solutions (1)
2,728 Views
3 Replies
Replies (3)
Message 2 of 4

rajasekaransurjen
Collaborator
Collaborator
Accepted solution

Hi,

Try this.... to delete all pointConstraint.

 

import maya.cmds as mc
sel = mc.ls(type="pointConstraint")
for all in sel:
    mc.select(all)
    mc.delete()

The following will delete all parentConstraint.

sel = mc.ls(type="parentConstraint")
mc.delete(sel)

The constraint node types are parentConstraint, orientConstraint, pointConstraint....

Message 3 of 4

Anonymous
Not applicable

thnx brother it worked out.

0 Likes
Message 4 of 4

rajasekaransurjen
Collaborator
Collaborator

You are welcome

0 Likes