ジャンプ先: 概要. 戻り値. 関連. フラグ. MEL 例.
scriptJob [-allChildren] [-attributeAdded string script] [-attributeChange string script] [-attributeDeleted string script] [-compressUndo boolean] [-conditionChange string script] [-conditionFalse string script] [-conditionTrue string script] [-connectionChange string script] [-disregardIndex] [-event string script] [-exists int] [-force] [-idleEvent script] [-kill int] [-killAll] [-killWithScene] [-listConditions] [-listEvents] [-listJobs] [-nodeDeleted string script] [-nodeNameChanged string script] [-optionVarChanged string script] [-parent string] [-permanent] [-protected] [-replacePrevious] [-runOnce boolean] [-timeChange script] [-uiDeleted string script]
scriptJob は、取り消し可能、照会不可能、および編集不可能です。
このコマンドは、MEL コマンドまたはスクリプトである「スクリプト ジョブ」を作成します。このジョブは、指定した条件、イベント、またはアトリビュートにアタッチされます。条件が目的の状態に切り替わるたびに(またはトリガが起動されるたびに)、スクリプトが実行されます。 スクリプト ジョブは、インタラクティブなアプリケーションでイベント ループに結び付けられています。このジョブはアイドル イベント中に実行されます。このことは、スクリプト ジョブがバッチ アプリケーションに存在しないことを意味しています。scriptJob コマンドは、バッチ モードでは何も行いません。 このトリガは非常に頻繁に発生するので、スピードを考慮して、再生中にイベントが転送されることはありません。つまり、scriptJob -tc tcCallback; を使用してアニメーションの動作を変更することはできません。代わりに、エクスプレッションか、レンダリング コールバック「preRenderMel」と「postRenderMel」を使用します。 条件のジョブをセット アップするときに、true 状態、false 状態、状態変更のジョブを同時にセットアップすると無効になります。この動作は未定義です。ユーザは、true 状態および/または false 状態のジョブ、あるいは状態変更のジョブのいずれかのみをセットアップできますが、同時に 3 つの状態のジョブをセットアップすることはできません。すなわち、次のように実行する場合、// アプリケーションの存続期間中に実行されるジョブを設定します。 // このジョブは「kill」コマンドを使用しても削除できません。 scriptJob -e "SelectionChanged" "print \"Annoying Message!\\n\"" -permanent; // true 状態についてジョブを設定します。 scriptJob -ct "playingBack" playBackCallback; // false 状態についてジョブを設定します。 scriptJob -cf "playingBack" playBackCallback; scriptJob -cc "playingBack" playBackCallback; を実行してはなりません。 実行すると、未定義の動作が引き起こされます。このコマンドは、使用可能な条件とイベントをリストする、そして実行中のジョブを中断するときにも使用できます。
| int | ジョブの中断に使用できるジョブ番号です。ジョブ番号は 0 以上の整数値です。 |
| string[] | list フラグ使用時の文字列リスト |
| boolean | exists フラグの場合 |
| ロング ネーム(ショート ネーム) | 引数タイプ | プロパティ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
-allChildren(-alc)
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-attributeAdded(-aa)
|
string script
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-attributeChange(-ac)
|
string script
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-attributeDeleted(-ad)
|
string script
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-compressUndo(-cu)
|
boolean
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-conditionChange(-cc)
|
string script
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-conditionFalse(-cf)
|
string script
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-conditionTrue(-ct)
|
string script
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-connectionChange(-con)
|
string script
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-disregardIndex(-dri)
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-event(-e)
|
string script
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-exists(-ex)
|
int
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-force(-f)
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-idleEvent(-ie)
|
script
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-kill(-k)
|
int
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-killAll(-ka)
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-killWithScene(-kws)
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-listConditions(-lc)
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-listEvents(-le)
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-listJobs(-lj)
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-nodeDeleted(-nd)
|
string script
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-nodeNameChanged(-nnc)
|
string script
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-optionVarChanged(-ovc)
|
string script
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-parent(-p)
|
string
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-permanent(-per)
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-protected(-pro)
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-replacePrevious(-rp)
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-runOnce(-ro)
|
boolean
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-timeChange(-tc)
|
script
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-uiDeleted(-uid)
|
string script
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// create a job that deletes things when they are seleted
int $jobNum = `scriptJob -ct "SomethingSelected" "delete" -protected`;
// Now display the job
scriptJob -listJobs;
// Now kill it (need to use -force flag since it's protected)
scriptJob -kill $jobNum -force;
// create a sphere, but print a warning the next time it
// is raised over 10 units high
global proc warn(){
float $height = `getAttr mySphere.ty`;
if ( $height > 10.0 ){
print ("Sphere is too high!\n");
}//end if
}// end proc
sphere -n mySphere;
scriptJob -runOnce true -attributeChange mySphere.ty warn;
// create a job to detect a new attribute named "tag"
//
global proc detectNewTagAttr() {
print(" New tag attribute was added\n" );
}
scriptJob -runOnce true -attributeAdded mySphere.tag detectNewTagAttr;
addAttr -ln "tag" -sn "tg" -dt "string" mySphere;
// list all the existing conditions and print them
// nicely
string $conds[] = `scriptJob -listConditions`;
int $i;
for ( $i=0; $i < size($conds); $i++ ){
print( $conds[$i]+"\n" );
}//end for