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

Synopsis

gradientControlNoAttr [-asString string] [-changeCommand string] [-currentKey int] [-currentKeyChanged script] [-currentKeyColorValue float float float] [-currentKeyCurveValue] [-currentKeyInterpValue int] [-dragCommand script] [-optionVar string] [-rampAsColor boolean] [-valueAtPoint float] [string]

gradientControlNoAttr is undoable, queryable, and editable.

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.

Return value

stringThe name of the port created or modified

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

Flags

asString, changeCommand, currentKey, currentKeyChanged, currentKeyColorValue, currentKeyCurveValue, currentKeyInterpValue, dragCommand, optionVar, rampAsColor, valueAtPoint
Long name (short name) Argument types Properties
-optionVar(-ov) string createqueryedit
Specifies the name of the option var used to store and retrieve the string value capturing the curve.
-valueAtPoint(-vap) float query
Used during query to specify the point at which to query the curve.

In query mode, this flag needs a value.

-currentKeyColorValue(-clv) float float float queryedit
Get or set the color of the currently selected key. Only useful if the ramp is set to be a color ramp.
-currentKeyCurveValue(-cvv) queryedit
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 queryedit
Get or set the interpolation value for the current key.
-asString(-as) string queryedit
Used to query and set the value of the ramp as a string of comma separated values
-rampAsColor(-rac) boolean createqueryedit
Sets whether the ramp should be viewed as a colour ramp or as a curve. Default is as a curve.
-currentKey(-ck) int createqueryedit
Returns the index of the currently selected key.
-currentKeyChanged(-ckc) script edit
Specifies a command to be executed whenever the selected key changes.
-changeCommand(-cc) string edit
Specifies a command to be executed whenever the value of this ramp is modified. This option should not be used when specifying an optionVar.
-dragCommand(-dc) script edit
Specifies a command to be executed while the ramp is being modified.

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

window -title "Gradient Control For OptionVar";
optionVar -stringValueAppend "falloffCurveOptionVar" "0,1,2";
optionVar -stringValueAppend "falloffCurveOptionVar" "1,0,2";
columnLayout;
gradientControlNoAttr -h 90 falloffCurve;
gradientControlNoAttr -e
       -optionVar "falloffCurveOptionVar"
       falloffCurve;
showWindow;

// Query for the value on the curve at a given position.
//
gradientControlNoAttr -valueAtPoint 0.5 -query falloffCurve;