Bug: CountChildren

BlitzMax Forums/MiniB3D Module/Bug: CountChildren

MikeHart(Posted 2008) [#1]
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.


simonh(Posted 2008) [#2]
Have you still got this file?


Floyd(Posted 2008) [#3]
I think test B3D file is it.

My free web storage wouldn't accept a zip file, but it hardly matters. Even unzipped it is less than 2K.


simonh(Posted 2008) [#4]
Thanks Floyd.