選択フィルタ/組み合わせフィルタでは、スーパークラス ID フィルタの登録に加えて クラス ID フィルタを追加できます。左下のリスト ボックスには、すべてのヘルパーおよびジオメトリ クラス ID のリストが表示されます。フィルタを追加する場合は、リストからエントリを選択し、リスト ボックス下の[追加]ボタンをクリックします。フィルタが、右下のリスト ボックスに表示されます。このリストに、現行のクラス ID フィルタがすべて表示されます。[OK]を押すと、追加されたクラス ID が[select filter]ドロップ ダウン リストに含まれます。
MAXScript のコールバックを使用して、カスタム スクリプト関数をフィルタとして登録することもできます。
メソッド
registerSelectFilterCallback <filterFunction> <name>
カスタム選択フィルタを登録します。2 つのパラメータは、登録されるフィルタ関数と[選択フィルタ]ドロップダウン リストに表示されるフィルタ名です。
フィルタ関数自体にも、1 つのパラメータ(チェックするノード)が必要です。
例 |
レンダリング可能な(ノードレベルの[レンダリング可能]プロパティが true に設定されている/[オブジェクト プロパティ]ダイアログ ボックスの[レンダリング可能]チェック ボックスにチェックマークが付いている)オブジェクトだけを抽出する場合、次の関数を登録します。 |
fn filterRenderableCallback node = --the node to be filtered is passed as argument ( node.renderable --return true if the node is renderable ) --Register the function as Select filter Callback function --The filter will appear under the name "Renderable": registerSelectFilterCallback filterRenderableCallback "Renderable" --To see how it works, execute the code below to generate 10 boxes --with random .renderable state for i = 1 to 10 do b = box pos:[i*30,0,0] renderable:((random 0.0 1.0) <0.5 ) --Now select the filter "Renderable" from the drop-down list and try --to select all 10 boxes - only those that are renderable will --be selected! |
プロトタイプ:
unregisterSelectFilterCallback <filterFunction>
指定したコールバック関数を選択フィルタの一覧から削除します。
例 |
unregisterSelectFilterCallback filterRenderableCallback |