pymel.core.windows.gradientControlNoAttr

gradientControlNoAttr(*args, **kwargs)

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.

Flags:
Long name (short name) Argument Types Properties
annotation (ann) unicode  
   
asString (asString) unicode ../../../_images/query.gif ../../../_images/edit.gif
 
Used to query and set the value of the ramp as a string of comma separated values
backgroundColor (bgc) float, float, float  
   
changeCommand (cc) callable ../../../_images/edit.gif
 
Specifies a command to be executed whenever the value of this ramp is modified. This option should not be used when specifying an optionVar.
currentKey (ck) int ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Returns the index of the currently selected key.
currentKeyChanged (ckc) callable ../../../_images/edit.gif
 
Specifies a command to be executed whenever the selected key changes.
currentKeyColorValue (clv) float, float, float ../../../_images/query.gif ../../../_images/edit.gif
 
Get or set the color of the currently selected key. Only useful if the ramp is set to be a color ramp.
currentKeyCurveValue (cvv) bool ../../../_images/query.gif ../../../_images/edit.gif
 
Get or set the value of the currently selected key. Only useful if the ramp is set to be a curve ramp.
currentKeyInterpValue (civ) int ../../../_images/query.gif ../../../_images/edit.gif
 
Get or set the interpolation value for the current key.
defineTemplate (dt) unicode  
   
docTag (dtg) unicode  
   
dragCallback (dgc) callable  
   
dragCommand (dc) callable ../../../_images/edit.gif
 
Specifies a command to be executed while the ramp is being modified. Flag can have multiple arguments, passed either as a tuple or a list.
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 ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Specifies the name of the option var used to store and retrieve the string value capturing the curve.
parent (p) unicode  
   
popupMenuArray (pma) bool  
   
preventOverride (po) bool  
   
rampAsColor (rac) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Sets whether the ramp should be viewed as a colour ramp or as a curve. Default is as a curve.
useTemplate (ut) unicode  
   
valueAtPoint (vap) float ../../../_images/query.gif
 
Used during query to specify the point at which to query the curve.
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 #

Previous topic

pymel.core.windows.gradientControl

Next topic

pymel.core.windows.gridLayout

Core

Core Modules

Other Modules

This Page