Home
Products
Community
Manuals
Contact
Login or Signup

Blitz3D Docs -> FindChild

FindChild ( entity,child_name$ )

Parameters:

entity - entity handle
child_name$ - child name to find within entity

Description:

Returns the first child of the specified entity with name matching child_name$.

See also: LoadAnimMesh, LoadMesh, GetChild, CountChildren.


Comments

Altanil(Posted 1+ years ago)
-


Zethrax(Posted 1+ years ago)
Most modelling programs will allow you to set the name of a mesh model. You can then use that name with FindString to find the entity handle of the specific mesh that you are looking for in a mesh hierarchy.

Make sure you use LoadAnimMesh to load multi-mesh entities. They will get combined into a single mesh if loaded with LoadMesh.

Note that FindChild works recursively, so it doesn't matter how deep in the mesh hierarchy your target mesh is.

eg.
Graphics3D 800, 600, 0, 2

cube1 = CreateCube()
cube2 = CreateCube()
cube3 = CreateCube()

NameEntity cube3, "cube3"

EntityParent cube2, cube1
EntityParent cube3, cube2

Print cube3
Print FindChild( cube1, "cube3" )

WaitKey
End



If you need to find out the names assigned to child entities, the code below will load the model you specify in the filepath$ variable and print out the namestring values for all of its children.
; Set this to the filepath of the file you wish to load.
filepath$ = ""

Graphics3D 800, 600, 0, 2

Global mesh = LoadAnimMesh( filepath$ )

OutputChildNames( mesh )

WaitKey

End


;---


Function OutputChildNames( entity )

Local i, count

Print EntityName( entity )

count = CountChildren( entity )
For i = 1 To count
	OutputChildNames( GetChild( entity, i ) )
Next
End Function



Blitz3D Manual Forum

BlitzPlus Equivalent Command