NewScene , false
set oRoot = Application.ActiveProject.ActiveScene.Root
oRoot.AddGeometry "Sphere", "MeshSurface", "mySphere"
oRoot.AddGeometry "Cone", "MeshSurface", "myCone"
oRoot.AddGeometry "Cone", "MeshSurface", "anotherCone"
oRoot.AddGeometry "Cube", "NurbsSurface", "myCube"
Application.LogMessage "** 1: Find the object whose name starts with 'Camera' **"
set obj = oRoot.FindChild( "Camera*" )
Application.LogMessage "Found child: " & obj.Name
Application.LogMessage "** 2: Find an object of type siLightPrimType **"
set obj = oRoot.FindChild( "", siLightPrimType )
Application.LogMessage "Found child: " & obj.Name
Application.LogMessage "** 3: Find an object that belongs to siMeshFamily family **"
set obj = oRoot.FindChild( , , Array(siMeshFamily) )
Application.LogMessage "Found child: " & obj.Name
Application.LogMessage "** 4: Find the object whose name start with 'an' and belongs to siMeshFamily family **"
set obj = oRoot.FindChild("an*",,Array( siMeshFamily ))
Application.LogMessage "Found child: " & obj.Name
' Expected results:
'INFO : ** 1: Find the object whose name starts with 'Camera' **
'INFO : Found child: Camera_Root
'INFO : ** 2: Find an object of type siLightPrimType **
'INFO : Found child: light
'INFO : ** 3: Find an object that belongs to siMeshFamily family **
'INFO : Found child: mySphere
'INFO : ** 4: Find the object whose name start with 'an' and belongs to siMeshFamily family **
'INFO : Found child: anotherCone
|