Go to: Synopsis. Return value. MEL examples.
exists string
exists is NOT undoable, NOT queryable, and NOT editable.
This command is designed to allow the user to query the existence of a command or Mel procedure. It takes one argument of type string. An integer value of 1 is returned if the argument represents the name of a Maya command, a built-in Mel command, or a user written Mel procedure or script. This command returns 0 if none of these can be found.| int | 0 or 1 |
if (`exists sphere`) {
sphere; // make a sphere
}
string $myCommand="cone";
if (`exists $myCommand`) {
eval $myCommand;
}