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

Synopsis

deleteExtension [-attribute string] [-forceDelete boolean] [-nodeType string]

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

This command is used to delete an extension attribute from a node type. The attribute can be specified by using either the long or short name. Only one extension attribute can be deleted at a time. Children of a compound attribute cannot be deleted, you must delete the complete compound attribute. This command has no undo, edit, or query capabilities.

Return value

intNumber of nodes with altered data after the delete

Keywords

attribute, dependency, graph, delete, extension

Related

addAttr, addExtension, aliasAttr, attributeInfo, connectAttr, deleteAttr, disconnectAttr, getAttr, getClassification, nodeType, objExists, objectType, renameAttr, setAttr

Flags

attribute, forceDelete, nodeType
Long name (short name) Argument types Properties
-nodeType(-nt) string create
The name of the node type.
-attribute(-at) string create
Specify either the long or short name of the attribute.
-forceDelete(-fd) boolean create
If this flag is set and turned ON then data values for the extension attributes are all deleted without confirmation. If it's set and turned OFF then any extension attributes that have non-default values set on any node will remain in place. If this flag is not set at all then the user will be asked if they wish to preserve non-default values on this attribute.

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

addExtension -nt planet -ln martians -sn mr -at double;
createNode planet -n jupiter;
createNode planet -n mars;
setAttr mars.mr 35;
// Delete an extension attribute named mr/martians.
// Only returns 1 since the planet node 'jupiter'
// does not have a non-default value on the extension.
deleteExtension -nt planet -forceDelete on -at mr;
// Return: 1 //
// The attribute is gone since it was forced out
attributeQuery -type planet -at mr -q -exists;
// Return: 0 //
// Re-add and delete the extension again, forcing the
// attribute to remain if non-default values exist.
addExtension -nt planet -ln martians -sn mr -at double;
setAttr mars.mr 35;
deleteExtension -nt planet -forceDelete off -at mr;
// Return: 0 //
// The attribute still exists since it had some non-default values
attributeQuery -type planet -at mr -q -exists;
// Return: 1 //
attributeQuery -n jupiter -at mr -q -exists;
// Return: 1 //