SIFilter

導入

v1.0

詳細

指定のフィルタリング タイプに基づき、与えられたリストのエレメントをフィルタリングした後、フィルタリングされたエレメントのリストを戻します。 PickObject と併用すると、別のコマンドにエレメントを渡す前に、選択されたオブジェクトを適切なフィルタによって確認できます。

スクリプト構文

oReturn = SIFilter( [InputObjs], [Type], [Include], [Mode] );

戻り値

フィルタ処理されたリストをXSICollectionとして戻します。

パラメータ

パラメータ タイプ 説明
InputObjs 文字列 フィルタするオブジェクトのリスト

デフォルト値: 現在選択されている値

Type 文字列 使用する FilterConstant(例:シーンオブジェクト、オペレータ、プリミティブ、マテリアルなど)。

注: カスタムフィルタ名にスペースがあるとSIFilterの呼び出しに失敗します。この問題を解決するには、スペースをすべてアンダースコアに置き換えてください。

デフォルト値: siGenericObjectFilter

Include Boolean フィルタに一致するオブジェクトを含める場合は True、フィルタに一致するオブジェクトを除く場合は False。

デフォルト値: True

Mode siFilterMode 検索モードでフィルタ処理します。 完全サーチは最も強力ですが、時間を多く要します。

デフォルト値: siQuickSearch

VBScript の例

' Create 2 objects, then select ALL objects in the scene:

CreatePrim "Sphere", "MeshSurface"

CreatePrim "Cone", "MeshSurface"

SelectAll

' From the selection list collection, get the light and camera only:

dim list

set list = GetValue ( "SelectionList" )

set LigAndCam = SIFilter( list, siLightFilter & ", " & siCameraFilter )

if TypeName( LigAndCam ) <> "Nothing" then

	LogMessage LigAndCam.Count & " light & camera(s) found."

	LogMessage vbTab & LigAndCam

end if

' Now get the 3D objects only, from the currently selected objects:

set AllObjects = SIFilter( , siObjectFilter )

if TypeName( AllObjects ) <> "Nothing" then

	set objects = SIFilter( AllObjects, "polygon_mesh", True )

	LogMessage objects.Count & " object(s) found."

	LogMessage vbTab & objects(0) & ", " & objects(1) 

	' Filter out polygon meshes objects:

	set non3DObjects = SIFilter( AllObjects, "polygon_mesh", False )

	if TypeName( non3DObjects ) <> "Nothing" then

		LogMessage non3DObjects.Count & " non-3D object(s) found."

		for each non3DObj in non3DObjects

			LogMessage vbTab & non3DObj 

		next

	end if

end if

' Running this script should log the following:

' ---------------------------------------------

'INFO : "2 light & camera(s) found."

'INFO : "	Camera,light"

'INFO : "2 object(s) found."

'INFO : "	sphere, cone"

'INFO : "4 non-3D object(s) found."

'INFO : "	Camera_Root"

'INFO : "	Camera"

'INFO : "	Camera_Interest"

'INFO : "	light"

関連項目

EnumElements SIMatchSubComponent