Code archives/3D Graphics - Mesh/List Mesh Hierarchy

This code has been declared by its author to be Public Domain code.

Download source code

List Mesh Hierarchy by jfk EO-111102003
This will simply dump the info on the screen but I guess it is trivial to write it to a file, store it in arrays or Types to be used for direct children entity handle access in a game or whatever.
It is useful when you don't know the Chidren Names of a Model and want to know them. Recursive Calls are limited to 50 Generations, edit this if required.

EDIT...
Oops - I have just seen that Rob posted an alomst identical Source... however - no we have a backup :).
; This recursive app will spy a Mesh Hierarchy's 
; Children Names up To 50 Generations.
Graphics3D 640,480,16,2

mesh=LoadAnimMesh("cass.3ds")
Global recursive_limit

hierarchy_tree(mesh)

WaitKey()
End

Function hierarchy_tree(m)
 If recursive_limit<=50
  recursive_limit=recursive_limit+1
  k=CountChildren(m)
  If k>0
   For i=1 To k
    m2=GetChild(m,i)
    Print String$("|",recursive_limit*3)+EntityName$(m2)
    hierarchy_tree(m2)
   Next
  EndIf
  recursive_limit=recursive_limit-1
 EndIf
End Function

Comments

None.

Code Archives Forum