Code archives/3D Graphics - Misc/shows the hierarchy of a model.

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

Download source code

shows the hierarchy of a model. by Rob 2002
Useful to check things are as they should be. This function and it's style is often useful for other things, such as making absolutely sure you're recursing through all child entities. A mistake some people make is forgetting children can have children.
;directory view of hierarchy
;check your DebugLog After calling - by Rob Cummings
Global tab ; makes debuglog output more readible (tabbing).

Graphics3D 640,480,16,2
mesh=LoadAnimMesh("mesh.3ds")

xtree(mesh)

End
Function xtree(ent)
	tab=tab+4
	For i=1 To CountChildren(ent)	
		child=GetChild(ent,i)
		name$=EntityName(child)
		DebugLog String(" ",tab)+child+" "+name
		xtree(child)
	Next
	tab=tab-4
End Function

Comments

None.

Code Archives Forum