移動先: 概要 戻り値 フラグ. Python 例.

概要

gradientControlNoAttr( [string] , [asString=string], [changeCommand=string], [currentKey=int], [currentKeyChanged=script], [currentKeyColorValue=[float, float, float]], [currentKeyCurveValue=boolean], [currentKeyInterpValue=int], [dragCommand=script], [optionVar=string], [rampAsColor=boolean], [valueAtPoint=float])

注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。

gradientControlNoAttr は 「元に戻す」が可能、「照会」が可能、「編集」が可能 です。

このコマンドは、ランプ(2D コントロール カーブ)の編集のための コントロールを作成します。作成されたコントロールは、エンコードされたグラディエント制御点を格納し、 読み込むために使用される optionVar にアタッチされます。

戻り値

string作成または修正されたポート名

戻り値の型は照会モードでは照会フラグが基になります。

フラグ

asString, changeCommand, currentKey, currentKeyChanged, currentKeyColorValue, currentKeyCurveValue, currentKeyInterpValue, dragCommand, optionVar, rampAsColor, valueAtPoint
ロング ネーム(ショート ネーム) 引数型 プロパティ
optionVar(ov) string createqueryedit
カーブをキャプチャする文字列値の格納や読み出しを行う際に使用する optionVar の名前を指定します。
valueAtPoint(vap) float query
照会時にカーブを照会するポイントを指定する場合に使用されます。

このフラグは照会モードでは値が必要になります。

currentKeyColorValue(clv) [float, float, float] queryedit
現在選択しているキーのカラーを取得または設定します。ランプがカラー ランプになるように設定されている場合のみ便利です。
currentKeyCurveValue(cvv) boolean queryedit
現在選択しているキーの値を取得または設定します。ランプがカーブ ランプになるように設定されている場合のみ便利です。
currentKeyInterpValue(civ) int queryedit
カレント キーの補間値を取得または設定します。
asString(asString) string queryedit
ランプの値をカンマで区切られた値の文字列として 照会および設定する場合に使用します。
rampAsColor(rac) boolean createqueryedit
ランプをカラー ランプとカーブのどちらとして表示するかを設定します。デフォルトでは、カーブとして表示されます。
currentKey(ck) int createqueryedit
現在選択しているキーのインデックスを返します。
currentKeyChanged(ckc) script edit
選択したキーが変更されたときに必ず実行するコマンドを指定します。
changeCommand(cc) string edit
このランプの値が修正されたときに実行するコマンドを指定します。optionVar を指定する際には、このオプションを使用しないでください。
dragCommand(dc) script edit
ランプの変更中に実行されるコマンドを指定します。

: コマンドの作成モードで使用可能なフラグ : コマンドの編集モードで使用可能なフラグ
: コマンドの照会モードで使用可能なフラグ : タプルまたはリストとして渡された複数の引数を持てるフラグ

Python 例

import maya.cmds as cmds

# Create a window with a gradient control for an optionVar
#
cmds.window( title='Gradient Control For OptionVar' )
cmds.optionVar(stringValueAppend=['falloffCurveOptionVar', '0,1,2'])
cmds.optionVar(stringValueAppend=['falloffCurveOptionVar', '1,0,2'])
cmds.columnLayout()
cmds.gradientControlNoAttr( 'falloffCurve', h=90)
cmds.gradientControlNoAttr( 'falloffCurve', e=True, optionVar='falloffCurveOptionVar' )
cmds.showWindow()

# Query for the value on the curve at a given position.
#
cmds.gradientControlNoAttr( 'falloffCurve', q=True, valueAtPoint=0.5 )