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

Synopsis

applyAttrPattern [-nodeType string] [-patternName string]

applyAttrPattern is undoable, NOT queryable, and NOT editable.

Take the attribute structure described by a pre-defined pattern and apply it either to a node (as dynamic attributes) or a node type (as extension attributes). The same pattern can be applied more than once to different nodes or node types as the operation duplicates the attribute structure described by the pattern. See the 'createAttrPatterns' command for a description of how to create a pattern.

Return value

intNumber of nodes or node types to which the attribute were added

Keywords

attribute, pattern

Related

addAttr, addExtension, createAttrPatterns, deleteAttrPattern, listAttrPatterns

Flags

nodeType, patternName
Long name (short name) Argument types Properties
-nodeType(-nt) string create
Name of the node type to which the attribute pattern is to be applied. This flag will cause a new extension attribute tree to be created, making the new attributes available on all nodes of the given type. If it is not specified then either a node name must be specified or a node must be selected for application of dynamic attributes.
-patternName(-pn) string create
The name of the pattern to apply. The pattern with this name must have been previously created using the createAttrPatterns command.

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

polySphere -n "sphere1";
applyAttrPattern -patternName "myXMLPattern" "sphere1";
// Result: 1 //

polySphere -n "sphere2";
polySphere -n "sphere3";
select sphere1 sphere2;
applyAttrPattern -patternName "myXMLPattern";
// Result: 2 //

applyAttrPattern -patternName "myXMLPattern" -nodeType "transform";
// Result: 1 //