Go to: Synopsis. Return value. Keywords. Flags. Python examples.

Synopsis

attrControlGrp([annotation=string], [attribute=name], [changeCommand=script], [enable=boolean], [handlesAttribute=name], [hideMapButton=boolean], [label=string], [preventOverride=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

attrControlGrp is NOT undoable, queryable, and editable.

This command creates a control of the type most appropriate for the specified attribute, and associates the control with the attribute. Any change to the control will cause a change in the attribute value, and any change to the attribute value will be reflected in the control. Not all attribute types are supported.

Return value

stringThe control name.

In query mode, return type is based on queried flag.

Keywords

attribute, control

Flags

annotation, attribute, changeCommand, enable, handlesAttribute, hideMapButton, label, preventOverride
Long name (short name) Argument types Properties
attribute(a) name createqueryedit
Sets or queries the attribute the control represents. The name of the attribute must be fully specified, including the name of the node. Some types of attributes are not supported, but most commonly used attribute types are.
changeCommand(cc) script createqueryedit
Sets or queries the change command of the control group. The change command will be executed when the control is used to change the value of the attribute.
enable(en) boolean createqueryedit
Sets or queries the enable state of the control group. The control is dimmed if the enable state is set to false.
hideMapButton(hmb) boolean createqueryedit
Force the map button to remain hidden for this control.
preventOverride(po) boolean createqueryedit
Sets or queries the prevent adjustment state of the control group. If true, the RMB menu for the control will not allow adjustments to be made.
label(l) string createqueryedit
Sets or queries the label of the control group.
annotation(ann) string createqueryedit
Sets or queries the annotation value of the control group.
handlesAttribute(ha) name queryedit
Returns true or false as to whether this command can create a control for the specified attribute.

In query mode, this flag needs a value.


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 have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

cmds.window()
cmds.columnLayout()
cmds.attrControlGrp( attribute='defaultResolution.width' )
cmds.showWindow()