This command creates a control for editing a ramp (2D control curve). The control attaches to an optionVar used to store and retrieve the encoded gradient control points stored in a string.
| Long name (short name) | Argument Types | Properties | |
|---|---|---|---|
| annotation (ann) | unicode | ||
| asString (asString) | unicode |
|
|
|
|||
| backgroundColor (bgc) | float, float, float | ||
| changeCommand (cc) | script |
|
|
|
|||
| currentKey (ck) | int |
|
|
|
|||
| currentKeyChanged (ckc) | script |
|
|
|
|||
| currentKeyColorValue (clv) | float, float, float |
|
|
|
|||
| currentKeyCurveValue (cvv) | bool |
|
|
|
|||
| currentKeyInterpValue (civ) | int |
|
|
|
|||
| defineTemplate (dt) | unicode | ||
| docTag (dtg) | unicode | ||
| dragCallback (dgc) | callable | ||
| dragCommand (dc) | script |
|
|
|
|||
| dropCallback (dpc) | callable | ||
| enable (en) | bool | ||
| enableBackground (ebg) | bool | ||
| exists (ex) | bool | ||
| fullPathName (fpn) | bool | ||
| height (h) | int | ||
| isObscured (io) | bool | ||
| manage (m) | bool | ||
| numberOfPopupMenus (npm) | bool | ||
| optionVar (ov) | unicode |
|
|
|
|||
| parent (p) | unicode | ||
| popupMenuArray (pma) | bool | ||
| preventOverride (po) | bool | ||
| rampAsColor (rac) | bool |
|
|
|
|||
| useTemplate (ut) | unicode | ||
| valueAtPoint (vap) | float |
|
|
|
|||
| visible (vis) | bool | ||
| visibleChangeCommand (vcc) | callable | ||
| width (w) | int | ||
Derived from mel command maya.cmds.gradientControlNoAttr
Example:
import pymel.core as pm
# Create a window with a gradient control for an optionVar
#
pm.window( title='Gradient Control For OptionVar' )
# Result: ui.Window('window1') #
pm.optionVar(stringValueAppend=['falloffCurveOptionVar', '0,1,2'])
pm.optionVar(stringValueAppend=['falloffCurveOptionVar', '1,0,2'])
pm.columnLayout()
# Result: ui.ColumnLayout('window1|columnLayout42') #
pm.gradientControlNoAttr( 'falloffCurve', h=90)
# Result: ui.GradientControlNoAttr('window1|columnLayout42|falloffCurve') #
pm.gradientControlNoAttr( 'falloffCurve', e=True, optionVar='falloffCurveOptionVar' )
# Result: ui.GradientControlNoAttr('columnLayout42|falloffCurve') #
pm.showWindow()
# Query for the value on the curve at a given position.
#
pm.gradientControlNoAttr( 'falloffCurve', q=True, valueAtPoint=0.5 )
# Result: 0.5 #