PDA

View Full Version : how to delete expressions??


nier
01-15-2008, 04:28 PM
Hi

I am trying to delete objects' expressions using Python, using the following code:


#option 1 (e = expression name)
cmds.delete(e)

#option 2
cmds.select(e, r=1)
cmds.delete()


But both give me the error: "TypeError: Object expression1 is invalid #"

But it seems to work in MEL, at least when I type it in the script editor...

Does anybody know how to solve this? Or maybe is there a better way to delete all expressions from a given object?

Thank you!
Daniel

phlam
01-17-2008, 04:29 PM
in the scriptEditor, this code works:

import maya.cmds as cmds

node = "pCube1"
cmds.select (node, replace=1)
cmds.delete (expressions=1)

CGTalk Moderation
01-17-2008, 04:29 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.