Go to: Synopsis. Return value. Keywords. Related. Flags. MEL examples.

Synopsis

warning [-noContext] [-showLineNumber boolean]

warning is NOT undoable, NOT queryable, and NOT editable.

The warning command is provided so that the user can issue warning messages from his/her scripts. The string argument is displayed in the command window (or stdout if running in batch mode) after being prefixed with a warning message heading and surrounded by the appropriate language separators (# for Python, // for Mel).

Return value

None

Keywords

debug, information, echo

Related

error, print

Flags

noContext, showLineNumber
Long name (short name) Argument types Properties
-noContext(-n) create
Do not include the context information with the warning message.
-showLineNumber(-sl) boolean create
Obsolete. Will be deleted in the next version of Maya. Use the checkbox in the script editor that enables line number display instead.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

proc lightWarning()
{
    $l = `ls -lights`;
    if (size($l) == 0) {
        warning "No Lights";
    }
}
lightWarning()
//
// The above will produce the following output:
//
//        // Warning: No Lights //
//
// When the option to show line numbers in errors is enabled the output will
// be the following:
//
//        // Warning: line 5: No Lights //
//