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

概要

scriptCtx [-baseClassName string] [-cumulativeLists boolean] [-enableRootSelection boolean] [-exitUponCompletion boolean] [-expandSelectionList boolean] [-finalCommandScript script] [-forceAddSelect boolean] [-ignoreInvalidItems boolean] [-lastAutoComplete boolean] [-setAllowExcessCount boolean] [-setAutoComplete boolean] [-setAutoToggleSelection boolean] [-setDoneSelectionPrompt string] [-setNoSelectionHeadsUp string] [-setNoSelectionPrompt string] [-setSelectionCount int] [-setSelectionHeadsUp string] [-setSelectionPrompt string] [-showManipulators boolean] [-title string] [-toolCursorType string] [-toolFinish script] [-toolStart script] [-totalSelectionSets int] string

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

このコマンドを使用すると、ユーザはセレクション ツールに基づいて独自のツールを作成することができます。多数のセレクション リストを収集する、選択項目の動作やセレクション マスクは完全にカスタマイズできるなどが可能です。

このコマンドは、実行前に処理されます。キーワード「$Selection#」(# は 1 以上の数字)には、セレクション セットを指定します。コンテキストには、$Selection# キーワードの代わりに置き換えられる複数のセレクション セットを MEL 文字配列の形式で指定することができます。セットごとに固有の項目をセットに指定する場合は、各セットで指定する必要があります。下記の例を参照してください。

さらに、作成するセレクションのタイプを指定するために、「selectType」コマンドのセレクション タイプ フラグをここで使用することができます。

戻り値

stringコンテキスト名

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

フラグ

baseClassName, cumulativeLists, enableRootSelection, exitUponCompletion, expandSelectionList, finalCommandScript, forceAddSelect, ignoreInvalidItems, lastAutoComplete, setAllowExcessCount, setAutoComplete, setAutoToggleSelection, setDoneSelectionPrompt, setNoSelectionHeadsUp, setNoSelectionPrompt, setSelectionCount, setSelectionHeadsUp, setSelectionPrompt, showManipulators, title, toolCursorType, toolFinish, toolStart, totalSelectionSets
ロング ネーム(ショート ネーム) 引数型 プロパティ
-title(-t) string createqueryedit
すべてのメッセージの前置きとして使用する文字列(すなわちツールの「名前」)を指定します。
-finalCommandScript(-fcs) script createqueryedit
ユーザが Enter キーを押し、コンテキストが完了したときに実行するスクリプトを指定します。保有しているセレクション セットの数に応じて、スクリプトで変数文字列 $Selection1[]、$Selection2[], ... を使用できます。
-toolStart(-ts) script createqueryedit
ユーザが最初にスクリプトを入力するときに実行されるスクリプトを指定します。
-toolFinish(-tf) script createqueryedit
ユーザがスクリプトを終了するときに実行されるスクリプトを指定します。
-toolCursorType(-tct) string createqueryedit
ツール内にある場合のツールのカーソル タイプを設定する、文字列の識別子を指定します。有効な識別子は次のとおりです。 「create」、「dolly」、「edit」、「pencil」、「track」、「trackHorizontal」、「trackVertical」、「transformation」、「tumble」、「zoom」、「zoomIn」、「zoomOut」、「flyThrough」、「dot」、「fleur」、「leftArrow」、「question」、「doubleHorizArrow」、「doubleVertArrow」、「sizing」、「dollyIn」、「dollyOut」、「brush」、「camera」、「noAccess」、「input」、「output」、「leftCycle」、「rightCycle」、「rightExpand」、「knife」。
-totalSelectionSets(-tss) int createqueryedit
セレクション セットの総数です。
-cumulativeLists(-cls) boolean createqueryedit
設定されている場合、セレクション リストは累積的です。たとえば、2 番目のリストには最初のリストの項目がすべて含まれ、3 番目のリストには 2 番目のリストの項目がすべて含まれるようになります。上記のフラグで指定したスクリプトにこの点が考慮されていることを確認してください。2 つ以上のセレクション セットがある場合に問題となります。
-expandSelectionList(-esl) boolean createqueryedit
設定されている場合、項目ごとに 1 つのコンポーネントを含むようにセレクション リストが展開されます。デフォルトではこのように設定します。そうでない場合、同一サーフェス上の 2 つのアイソパラムが 1 つの項目として表示されます。
-showManipulators(-sm) boolean createqueryedit
設定されている場合、すべてのアクティブ オブジェクトに対してマニピュレータが表示されます。 これは基本的には、マニピュレータの表示ツール(Show Manipulator Tool)を使用するようなものです。
-enableRootSelection(-ers) boolean createqueryedit
設定されている場合、ルートのトランスフォーム レベルにある項目を選択できます。デフォルトは false です。
-ignoreInvalidItems(-iii) boolean createqueryedit
複数のセレクション セットがある場合、「セレクション セットを完了」した時点で セレクション セットの状態が記録されます。その際に、そのリスト内のいくつかの項目を削除し、1 つまたは複数のセレクション セット内の項目を無効にできます。このフラグが設定されている場合、それらの無効な項目は検出されますが無視されます。これが発生したことを知ることはできません。これは、あたかも無効な項目が最初の場所では選択されないようなものです(ただし、セレクション セット内には必要なだけの項目が含まれていないことになります)。このフラグが設定されていない場合、警告メッセージが表示され、エラー状態が原因でコマンドの最後のコールバック スクリプトが実行されない可能性があります。
-exitUponCompletion(-euc) boolean createqueryedit
設定されている場合、最後のセレクション セットを完了するとツールが終了します。デフォルトは true です。
-baseClassName(-bcn) string createqueryedit
この文字列を使用して、ツールのプロパティ シートの関数名を生成します。たとえば「myScriptTool」が指定されている場合、プロパティ シートには関数「myScriptToolValues」と「myScriptToolProperties」が使用されます。デフォルトは「scriptTool」です。
-lastAutoComplete(-lac) boolean createqueryedit
最後のセレクション セットに対して自動完了機能が設定されている場合は true、設定されていない場合は false。通常は照会に使用しますが、-sac/setAutoComplete フラグも指定されている場合は、 -sac フラグが優先します。
-forceAddSelect(-fas) boolean createqueryedit
true に設定されている場合、最初のセレクション セットで -setAutoToggleSelection(下記を参照)とともに使用すると、モディファイア キーが押されない限り、前の結果の計算後に最初に行う選択が「Shift」キーによる選択になります。デフォルトは false です。

各セレクション セットのためのフラグです。これらのフラグは多目的に使用されます。

-setNoSelectionPrompt(-snp) string createeditmultiuse
何も選択されていないときにヘルプとして表示される文字列を指定します。これはセレクション セットごとに個別に設定する必要があります。
-setSelectionPrompt(-ssp) string createeditmultiuse
選択項目がある場合に、ヘルプとして表示される文字列を指定します。これはセレクション セットごとに個別に設定する必要があります。
-setDoneSelectionPrompt(-dsp) string createeditmultiuse
setAutoComplete が設定されていない場合(下記を参照)、特定のセレクション セット内の項目が十分な数になると同時にこの文字列が表示されます。これを設定してないけれども必要になった場合は、-setSelectionPrompt フラグに設定した文字列と同じ文字列が使用されます。
-setNoSelectionHeadsUp(-snh) string createeditmultiuse
何も選択されていないときにヘッドアップ プロンプトとして表示される文字列を指定します。これはセレクション セットごとに個別に設定する必要があります。
-setSelectionHeadsUp(-ssh) string createeditmultiuse
何かが選択されているときにヘッドアップ プロンプトとして表示される文字列を指定します。これはセレクション セットごとに個別に設定する必要があります。
-setSelectionCount(-ssc) int createeditmultiuse
このセレクション セット内の項目数です。0 は、完了するために必要な数を意味します。
-setAllowExcessCount(-sae) boolean createeditmultiuse
設定されている場合、項目数は最小であるとみなされます。
-setAutoComplete(-sac) boolean createeditmultiuse
true に設定されている場合、指定した数の項目が選択されると同時に、ツールは次のセレクション セットを開始するか、コマンドを実行します。
-setAutoToggleSelection(-sat) boolean createeditmultiuse
true に設定すると、モディファイア キーを押していない場合に Shift キーを押しているような状態になります。つまり、デフォルトで「切り替え選択」動作を取得します。これは 3D ビューのみに適用され、ハイパーグラフ(Hypergraph)やアウトライナ(Outliner)などで行われる選択には通常の規則が適用されます。

: コマンドの作成モードで使用可能なフラグ : コマンドの編集モードで使用可能なフラグ
: コマンドの照会モードで使用可能なフラグ : 1 つのコマンドで複数回使用可能なフラグ

MEL 例

// Simple example of "attach curve" tool created using scriptCtx. This tool
// prompts the user to select two curves to attach. As soon as two curves
// are selected, the attach is performed. It uses the selection type
// flag 'curveParameterPoint' from "selectType" command to specify the
// selection mask for this tool.

scriptCtx
    -title "Attach Curve"
    -totalSelectionSets 1
    -fcs "select -r $Selection1; performAttachCrv 0;"
    -cumulativeLists true
    -expandSelectionList true
    -setNoSelectionPrompt "Select two curves close to the attachment points"
    -setSelectionPrompt "Select a second curve close to the attachment point"
    -setDoneSelectionPrompt "Never used because setAutoComplete is set"
    -setAutoToggleSelection true
    -setSelectionCount 2
    -setAutoComplete true
    -curveParameterPoint true
    attachTool;


// And a more complex example of fillet blend tool (two sets of any number
// of "surface curves").  Notice how the selection lists are passed as
// arguments to the callback function, performBlendGiven.

scriptCtx
           -i1 "blendSurface.xpm"

           -title "Fillet Blend Tool"
           -toolCursorType  "edit"
           -totalSelectionSets 2
           -cumulativeLists false
           -showManipulators true
           -expandSelectionList true
           -fcs ("performBlendGiven $Selection1 $Selection2")

           -setNoSelectionPrompt ("Select left edge surface curves.")
           -setSelectionPrompt ("Select additional surface curves for " +
                                "the left edge or hit ENTER to start " +
                                "the right edge selection.")

         -setAutoToggleSelection true
           -setAutoComplete false
           -setSelectionCount 0
         -isoparm true
         -curveOnSurface true
         -surfaceEdge true

           -setNoSelectionPrompt "Select right edge surface curves."
           -setSelectionPrompt ("Select additional surface curves " +
                                "for the right edge or hit " +
                                "ENTER to compute blend.")

         -setAutoToggleSelection true
         -setAutoComplete false
         -setSelectionCount 0
         -isoparm true                    // selectType flag
         -curveOnSurface true            // selectType flag
         -surfaceEdge true                // selectType flag

           blendContext;


// Here's Birail 3+ where you select any number of curves, then 2 rails:

       scriptCtx
           -i1 "birail3Gen.xpm"

           -title "Birail 3+ Tool"
           -toolCursorType "edit"
           -totalSelectionSets 2
           -cumulativeLists true
           -expandSelectionList true
           -fcs ("select -r $Selection2; " +
                 "performBirail 0 3 \"birailThreePlusProfileContext\"")

           -setNoSelectionPrompt "Select any number of profiles"
           -setSelectionPrompt "Select additional profiles or hit ENTER"
           -setDoneSelectionPrompt ("Profiles selected.  " +
                                    "Hit ENTER to start rail selection.")
         -setAutoToggleSelection true
           -setAutoComplete false
           -setSelectionCount 0
           -nurbsCurve true
         -isoparm true
         -curveOnSurface true
         -surfaceEdge true
           -polymeshEdge true

           -setNoSelectionPrompt "Select two rails"
           -setSelectionPrompt "Select the second rail"
           -setDoneSelectionPrompt ("Rails selected.  " +
                                    "Hit ENTER to compute birail.")
         -setAutoToggleSelection true
         -setAutoComplete false
         -setSelectionCount 2
           -nurbsCurve true
         -isoparm true
         -curveOnSurface true
         -surfaceEdge true
           -polymeshEdge true

           birailThreePlusProfileContext;


// userBirailContextCallback has "true" as the first argument, which suggests
// that $Selection2 contains all of $Selection1 items (as -cumulativeLists
// true is specified in the tool creation.)