Go to: Synopsis. Return value. Keywords. Related. Flags. MEL examples.
lockNode [-ignoreComponents] [-lock boolean]
lockNode is undoable, queryable, and NOT editable.
Locks or unlocks one or more dependency nodes. A locked node is restricted
in the following ways:
- It may not be deleted.
- It may not be renamed.
- Its parenting may not be changed.
- Attributes may not be added to or removed from it.
- Locked attributes may not be unlocked.
- Unlocked attributes may not be locked.
Note that an unlocked attribute of a locked node may still have its value
set, or connections to it made or broken. For more information on attribute
locking, see the setAttr command.
If no node names are specified then the current selection list is used.
Sets are automatically expanded to their constituent objects.
None
For regular command execution.
boolean[]
For query execution.
In query mode, return type is based on queried flag.
node, dependency, graph, lock
delete, group, instance, parent, rename, setAttr, ungroup
ignoreComponents, lock
| Long name (short name) |
argument types |
Properties |
-lock(-l)
|
boolean
|

|
|
Specifies the new lock state for the node. The default is true.
|
|
-ignoreComponents(-ic)
|
|

|
|
Normally, the presence of a component in the list of objects to be locked
will cause the command to fail with an error. But if this flag is supplied
then components will be silently ignored.
|
|
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
|
// create a sphere, lock it, then try to delete it.
sphere -n sphere1;
lockNode sphere1;
delete sphere1;
// Error: Cannot delete locked nodes.
// Unlock the sphere, then it can be deleted.
lockNode -lock off sphere1;
delete sphere1;