On Thu, Aug 27, 2009 at 22:13, Taylor Carrasco<[email protected]> wrote:
> Is there a way to validate a mel command is valid (not necessarily that it
> will execute properly) before running it?
>
> Something like .....
> cmdValid("setAttr "PUP1:root_ctrl.extraRotY" 20;") returns true
> cmdValid("3etAttr "PUP1:root_ctrl.extraRotY" 20;") returns false

If it's just the command itself that you're concerned about, as
opposed to problems with its arguments, then use 'exists':

    exists("setAttr) returns true
    exists("3etAttr") returns false

or, from Python:

    import maya.mel as mel

    mel.eval('exists("setAttr")') returns true
    mel.eval('exists("3etAttr")') returns false

-- 
-deane

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---

Reply via email to