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

Synopsis

delete [-all] [-attribute string] [-channels] [-constraints] [-constructionHistory] [-controlPoints boolean] [-expressions] [-hierarchy string] [-inputConnectionsAndNodes] [-shape boolean] [-staticChannels] [-timeAnimationCurves boolean] [-unitlessAnimationCurves boolean] objects

delete is undoable, NOT queryable, and NOT editable.

This command is used to delete selected objects, or all objects, or objects specified along with the command. Flags are available to filter the type of objects that the command acts on. At times, more than just specified items will be deleted. For example, deleting two CVs in the same "row" on a NURBS surface will delete the whole row.

Return value

None

Flags

all, attribute, channels, constraints, constructionHistory, controlPoints, expressions, hierarchy, inputConnectionsAndNodes, shape, staticChannels, timeAnimationCurves, unitlessAnimationCurves
Long name (short name) Argument types Properties
-attribute(-at) string createmultiuse
List of attributes to select

In query mode, this flag needs a value.

-hierarchy(-hi) string create
Hierarchy expansion options. Valid values are "above," "below," "both," and "none." (Not valid for "pasteKey" cmd.)

In query mode, this flag needs a value.

-shape(-s) boolean create
Consider attributes of shapes below transforms as well, except "controlPoints". Default: true. (Not valid for "pasteKey" cmd.)

In query mode, this flag needs a value.

-controlPoints(-cp) boolean create
This flag explicitly specifies whether or not to include the control points of a shape (see "-s" flag) in the list of attributes. Default: false. (Not valid for "pasteKey" cmd.)

In query mode, this flag needs a value.

-all(-all) create
Remove all objects of specified kind, in the scene. This flag is to be used in conjunction with the following flags.
-inputConnectionsAndNodes( -icn) create
Break input connection to specified attribute and delete all unconnected nodes that are left behind. The graph will be traversed until a node that cannot be deleted is encountered.
-constructionHistory(-ch) create
Remove the construction history on the objects specified or selected.
-staticChannels(-sc) create
Remove static animation channels in the scene. Either all static channels can be removed, or the scope can be narrowed down by specifying some of the above mentioned options.
-channels(-c) create
Remove animation channels in the scene. Either all channels can be removed, or the scope can be narrowed down by specifying some of the above mentioned options.
-unitlessAnimationCurves( -uac) boolean create
Modifies the -c/channels and -sc/staticChannels flags. When true, only channels connected to unitless-input animation curves (for instance, those created by 'setDrivenKeyframe' will be deleted. When false, no unitless-input animation curves will be deleted. Default: true.
-timeAnimationCurves(-tac) boolean create
Modifies the -c/channels and -sc/staticChannels flags. When true, only channels connected to time-input animation curves (for instance, those created by 'setKeyframe' will be deleted. When false, no time-input animation curves will be deleted. Default: true.
-expressions(-e) create
Remove expressions in the scene. Either all expressions can be removed, or the scope can be narrowed down by specifying some of the above mentioned options.
-constraints(-cn) create
Remove selected constraints and constraints attached to the selected nodes, or remove all constraints in the scene.

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

// To delete selected objects use:
delete;

// To delete a few specific objects like surfaceShape1, surface1 and
// paramCurve1 use:
delete surfaceShape1 surface1 paramCurve1;

// To delete all channels in the scene:
delete -all -c;

// To delete static channels connected to selected nodes:
delete -sc;

// To delete motion path nodes connected to selected nodes:
delete -mp;

// To delete all expressions in the scene:
delete -all -e;

// To delete selected constraints and constraints attached to selected nodes:
delete -cn;

// Notes:

// The -at, -h, -s and -cp flags only apply when either -c/channels
// or -sc/-staticChannels or -e/-expressions options are specified.