v1.0
親、子、またはシブリング オブジェクトを選択します。エレメントを選択しない場合は、NavigateNode を使用することを検討してください。
SelectNeighborObj( [InputObjs], [NavigDirection], [HierarchyLevel], [AddToSelection] ); |
パラメータ | タイプ | 説明 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
InputObjs | 文字列 |
オブジェクトのリスト。 デフォルト値: 現在選択されている値 |
||||||||||||
NavigDirection | Integer |
ナビゲートする方向 デフォルト値: 0
|
||||||||||||
HierarchyLevel | 文字列 |
階層のオブジェクトを選択する方法を指定します。 デフォルト値: "ASITIS"
|
||||||||||||
AddToSelection | Boolean |
選択対象に追加する場合は True、選択対象を置換する場合は False。 デフォルト値: False |
' Given this hierarchy: ' ' cube ' cube1 ' cube2 ' sphere ' cone ' ' the following example will invoke SelectNeighborObj many times ' each time selecting a different part of the hierarchy. NewScene CreatePrim "Cube", "MeshSurface" SetValue "cube.cube.length", 12 CreatePrim "Cube", "MeshSurface" SetValue "cube1.cube.length", 10 CopyPaste "cube1", , "cube", 1 CreatePrim "Cube", "MeshSurface" CopyPaste "cube2", , "cube1", 1 CreatePrim "Sphere", "MeshSurface" CopyPaste "sphere", , "cube1", 1 CreatePrim "Cone", "MeshSurface" CopyPaste "cone", , "cube1", 1 MsgBox "Let's now select the parent of cube2 (cube1)" SelectNeighborObj "cube2" MsgBox "Let's now select the first child of cube1 (cube2)" SelectNeighborObj "cube1", 1 MsgBox "Let's now select the next sibling of sphere (cone)" SelectNeighborObj "sphere", 3 MsgBox "Let's now add the parent of cube2 (cube1) to the selection" SelectNeighborObj "cube2", , , True MsgBox "Let's now select the parent of cube (scene root)" SelectNeighborObj "cube" MsgBox "Let's now go through all direct children of the scene root and log its name" dim obj, first, child ' get first child (Camera_Root) of the scene root SelectObj "Scene_Root" set obj = GetValue( "SelectionList" ) SelectNeighborObj obj(0), 1 set first = GetValue( "SelectionList" ) ' lets log the name of that first child LogMessage "First child of " & obj(0) & " is " & first ' get sibling of that object (light) SelectNeighborObj first, 3 ' get next sibling set child = GetValue( "SelectionList" ) ' log its name and get new sibling ' and loop until no more sibling do until child = first LogMessage "Next sibling is " & child SelectNeighborObj child, 3 ' get next sibling set child = GetValue( "SelectionList" ) loop ' The log of the example above should be : 'INFO : "First child of Scene_Root is Camera_Root" 'INFO : "Next sibling is light" 'INFO : "Next sibling is cube" |