X3DObject.FindChildren2

導入

v9.0 (2011)

詳細

検索基準に一致するX3DObjectオブジェクトの子のX3DObjectをすべて検索します。デフォルトでは、検索は再帰的に行われます。関数は、基準(名前、タイプ、およびファミリ)を満たすオブジェクトをすべて戻します。このメソッドは一般的に、3d オブジェクトからなるシーンを階層的に移動する際に使用します。

指定されたModelの下のX3DObjectの子をすべて取得するには(すべてのX3DObject内にネストされているもの、X3DObjectの子として関連付けられているものを含む)、引数を指定せずにこのメソッドを呼び出します。シーン内のすべてのX3DObjectオブジェクトを取得する場合は、FindObjectsを使用する方が効率的です。

このメソッドはX3DObject.FindChildrenとは異なり、オブジェクトのファミリと指定されたファミリが一致してもオブジェクト自身を戻しません。たとえば、cube.FindChildren("", "", si3DObjectFamily)を呼び出すと、立方体そのものを含むコレクションが戻されますが、このメソッドは空のコレクションを戻します。

スクリプト 構文

oReturn = X3DObject.FindChildren2( [Name], [Type], [Family], [Recursive] );

戻り値

X3DObjectCollection

パラメータ

パラメータ タイプ 詳細
Name StringまたはCollectionItem 名前表現またはCollectionItem。表現にはワイルドカード文字を含めることもできます。
String siTypeで定義されているオブジェクトのタイプ。タイプを使用しない場合は空の文字列になります。タイプには、特定の x3DObject タイプ(siModelType、si3DObjectType など)とプリミティブタイプ(siPolyMeshType、siSrfMeshPrimType など)があります。プリミティブタイプを指定した場合は、このタイプのプリミティブが定義されている子オブジェクトのみが関数の対象になります。有効なタイプを以下に示します。

指定可能な値:

説明:

si3DObjectType 3D Object タイプ
siArcPrimType Implicit Arc Primitive タイプ
siAttractorCtrlType Attractor Control Object タイプ(電気力)
siCameraPrimType Camera Primitive タイプ
siCameraRootPrimType Camera Root primitive タイプ
siChainBonePrimType Chain Bone Primitive タイプ
siChainEffPrimType Chain End Effector Primitive タイプ
siChainRootPrimType Chain Root Primitive タイプ
siCirclePrimType Implicit Circle Primitive タイプ
siCloudPrimType Cloud Primitive タイプ
siConePrimType Cone Primitive タイプ
siCrvListAggregatePrimType NURBS Curve List Aggregate Primitive タイプ
siCrvListPrimType NURBS Curve List Primitive タイプ
siCubePrimType Cube Primitive タイプ
siCylinderPrimType Cylinder Primitive タイプ
siDiscPrimType Disc Primitive タイプ
siDodecahedronPrimType Dodecahedron Primitive タイプ
siDragCtrlPrimType Drag Control Primitive タイプ
siEddyCtrlPrimType Eddy Control Primitive タイプ
siFanType Fan Force Object タイプ
siFurPrimType Fur Primitive タイプ
siGeoShaderPrimType GeoShader Primitive タイプ
siGravityCtrlType Gravity Force Control Object タイプ
siGridPrimType Grid Primitive タイプ
siIcosahedronPrimType Icosahedron Primitive タイプ
siLatticePrimType Lattice Primitive タイプ
siLightPrimType Light Primitive タイプ
siModelNullPrimType Model Null Primitive タイプ
siModelType 3D Model タイプ
siNullPrimType Null Primitive タイプ
siOctahedronPrimType Octahedron Primitive タイプ
siPolyMeshType Polygon Meshタイプ
siSpherePrimType Sphere Primitive タイプ
siSpiralPrimType Implicit Spiral Primitive タイプ
siSpotInterestPrimType Spot Interest Primitive タイプ
siSpotRootPrimType Spot Root Primitive タイプ
siSquarePrimType Implicit Square Primitive タイプ
siSrfMeshPrimType NURBS Surface Mesh Primitive タイプ
siTetrahedronPrimType Tetrahedron Primitive タイプ
siTorusPrimType Torus Primitive タイプ
siTurbulenceCtrlPrimType Turbulence Control Primitive タイプ
siVolumeDeformType Volume Deform タイプ(インプリシット球のボリューム)
siVortexCtrlType Vortex Control Object タイプ(磁力)
siWaveCtrlType Wave Control Object タイプ
siWindType Wind Force Object タイプ
Family siFamilyまたは siFamilyエレメントのArray siFamilyで定義されているファミリの配列、必要ない場合は空の配列。ファミリを使用して検索を絞り込みます。配列には、X3DObject ファミリ(si3DObjectFamilyなど)やプリミティブファミリ(siNurbsSurfaceMeshFamily、siNullPrimitiveFamilyなど)があります。指定されたファミリに一致する子オブジェクトだけが処理されます。プリミティブファミリを指定した場合は、そのファミリのいずれかに属するプリミティブが定義されているオブジェクトのみが対象になります。有効なファミリを以下に示します。

指定可能な値:

説明:

si3DObjectFamily 3D Object ファミリ
siCameraFamily Camera ファミリ
siChainElementFamily Chain Element ファミリ
siControlObjectFamily Control Object ファミリ
siCurveFamily Curve Geometry ファミリ
siGeometryFamily Geometry ファミリ
siGeometryShaderFamily Geometry Shader ファミリ
siImplicitGeometryFamily Implicit Geometry ファミリ
siLatticeFamily Lattice ファミリ
siLightPrimitiveFamily Light Primitive ファミリ
siMeshFamily Mesh Geometry ファミリ
siNullPrimitiveFamily Null Primitive ファミリ
siNurbsCurveListFamily Nurbs CurveList Geometry ファミリ
siNurbsSurfaceMeshFamily Nurbs Surface Mesh Geometry ファミリ
siSurfaceCurveFamily Surface Curve Geometry ファミリ
siSurfaceFamily Surface Geometry ファミリ
Recursive Boolean True の場合は、再帰的に検索します。False の場合は、直接の子について検索します。この再帰検索では、オブジェクトの下にネストされている任意のX3DObjectの内容も検索されます。

デフォルト値: True

Python の例

#
# FindChildren vs. FindChildren2 Python Example
#
from win32com.client import constants as const
Application.NewScene("", False)
# Create a cube
Application.CreatePrim("Cube", "MeshSurface", "cube", "")
root = Application.ActiveSceneRoot
cube = root.FindChild("cube")
# Use "FindChildren" to get the "si3DObjectFamily" children of the cube
# NOTE: FindChildren includes the parent if it is of the same family
children = cube.FindChildren("", "", const.si3DObjectFamily, True)
# The count will be one even if the cube has no children, because the
# cube family is of si3DObjectFamily
Application.LogMessage( "FindChildren  count: " + str(children.Count))
# Use "FindChildren2" to get the "si3DObjectFamily" children of the cube
# NOTE: FindChildren2 always ignore the parent regarless of its family
children = cube.FindChildren2("", "", const.si3DObjectFamily, True)
# The count will be zero because the cube has no children
Application.LogMessage( "FindChildren2 count: " + str(children.Count))
//Expected Results:
# INFO : FindChildren  count: 1
# INFO : FindChildren2 count: 0

関連項目

X3DObject.Children X3DObject.FindChild X3DObject.FindChild2 EnumElements