I understood you clearly and I've now tested my theory and it's correct. If you load only ONE model file with three models inside that file, CountChildren returns 3.
I exported one FBX with three models in it and the below code returned 3.
function App:Start()
--Create a window
self.window = Window:Create()
self.context = Context:Create(self.window)
self.world = World:Create()
local camera = Camera:Create()
camera:SetRotation(35,0,0)
camera:Move(0,0,-3)
local light = DirectionalLight:Create()
light:SetRotation(35,35,0)
--Load a model
self.entity = Model:Load("Models/3objects.mdl")
return true
end
function App:Loop()
if self.window:Closed() or self.window:KeyHit(Key.Escape) then return false end
Time:Update()
self.world:Update()
self.world:Render()
self.context:SetBlendMode(Blend.Alpha)
self.context:DrawText("The entity has "..self.entity:CountChildren().." children.",2,2)
self.context:Sync()
return true
end