Bug: CountChildren

BlitzMax Modules Forums/MiniB3D/Bug: CountChildren

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi folks,

I think when a B3D file is loaded, the last child isn't stored right.

'--------------------------------------------------------------------
' Bugtest countchildren
'--------------------------------------------------------------------

Import sidesign.minib3D
file$ = "1test.b3d"

Graphics3D(640,480,32,2)
camera=CreateCamera() 
PositionEntity camera,0,30,-60 
light=CreateLight() 

model = LoadAnimMesh(file$)
If (Not model) RuntimeError("Invalid File")


PointEntity camera,model
TurnEntity model, 0,0,0

root = FindChild(model,"root")
childcount=CountChildren(model)
DebugLog "Root Children:"+childcount

GetCh(model,0)

While Not KeyHit(1)
	
	RenderWorld()
	
	Flip

Wend


Function GetCh(model,tabc)
	count = CountChildren(model)
	For i = 1 To count
		child = GetChild(model,i)
		ccount = CountChildren(child)
		DebugLog String$(" ",tabc)+ "Child: "+EntityName(child)+"    ("+ccount +" children)" 
		GetCh(child,tabc+4)
	Next 
	Return 0
End Function



Look at this file.

http://www.fantomgl.com/testb3d.zip

The Camera02 child should have 1 child, but MiniB3d reports zero.