InvertSelection

InvertSelection

導入

v1.0

詳細

現在選択されているエレメントを選択解除し、指定されたエレメントを選択します。

注: SelectionList 引数にエラーが含まれる場合、コマンドは失敗します。

スクリプト構文

InvertSelection( [SelFilter], [CheckComponentVisibility], [CheckObjectSelectability] );

パラメータ

パラメータ タイプ 説明
SelFilter FilterConstant 選択するエレメントのタイプを指定する選択フィルタ。

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

CheckComponentVisibility siComponentVisibilityMode コマンドを、表示されたコンポーネントにのみ適用するかどうかを指定します。

デフォルト値: siIgnoreComponentVisibility

指定可能な値:

説明:

siIgnoreComponentVisibility コンポーネントが表示されているかどうかにかかわらず、コマンドが適用されます。
siCheckComponentVisibility 表示されたコンポーネントにのみ、コマンドが適用されます。
CheckObjectSelectability Boolean 選択不可としてマーキングされたオブジェクトを選択するかどうかを指定します。

デフォルト値: False

指定可能な値:

説明:

False 選択不可としてマーキングされたオブジェクトも選択します。
True 選択不可としてマーキングされたオブジェクトは選択しません。

1. VBScript の例

NewScene 

' Create some objects and an extra light to play with

CreatePrim "Cube", "MeshSurface"

Translate , -6, -0.995037190209989, 9.95037190209989E-02, siAbsolute, siView, siObj, siXYZ, True, , , , , , , , , 0

Scale , 0.46615087040619, 0.46615087040619, 0.46615087040619, siRelative, siGlobal, siObj, siXYZ, , , , , , , , 0

CreatePrim "Sphere", "MeshSurface"

Translate , 6, -0.995037190209989, 9.95037190209989E-02, siAbsolute, siView, siObj, siXYZ, True, , , , , , , , , 0

GetPrimLight "Infinite.Preset", "Infinite"

SelectObj "Cube,Infinite"

' Deselect all selected objects, and select all unselected objects 

PrintSelection

InvertSelection "object"

PrintSelection

' Note that when you use a filter, everything that does not match the filter is unselected 

' For example, this command inverts the selection status of all the lights, and unselects 

' all other elements in the scene. 

InvertSelection "light" 

PrintSelection

' Invert the selection of some components

SetSelFilter "Vertex"

SelectGeometryComponents "cube.pnt[3,4]"

PrintSelection

InvertSelection "point" 

PrintSelection

Sub PrintSelection

	msg = "Selection:"

	if Selection.count = 0 then

		msg = msg & " <empty>"

	else

		for each obj in Selection

			msg = msg & " " & obj

		next

	end if

	logmessage msg

End Sub

2. VBScript の例

NewScene 

' Create a sphere, hide some polygons

CreatePrim "Sphere", "MeshSurface" 

ActivatePolygonSelTool 

SelectGeometryComponents "sphere.poly[4,12,20,28,36,44,52,60]"

ToggleVisibility

' Select the right half of the sphere.

SelectGeometryComponents "sphere.poly[16-47]"

' Invert the poly selection, ignoring the fact that some of the polys are hidden

MsgBox "Will now InvertSelection ignoring component visibility..."

InvertSelection , siIgnoreComponentVisibility

MsgBox "Notice some of the hidden polygons are selected"

' Invert the poly selection again, taking into account the fact that some of the polys are hidden

MsgBox "Will now InvertSelection again, but checking component visibility..."

InvertSelection , siCheckComponentVisibility 

MsgBox "Notice no hidden polygons are selected"