Thank you!
The network debug helps me a lot.
BTW: I think assimp is broken somehow.
Do you know what's going on? :
This is what I put in:
FBX, with one single frame of animation. All objects in scene are rigged.
This is what AGK's LoadObjectWithChildren gives me:
Children list seems okay, aswell as the animation list
The Code to debug object information:
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "FBXTest" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 0 )
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
obj = LoadObjectWithChildren("test2.FBX")
SetObjectRotation(obj,90,0,0)
FixObjectPivot(obj)
SetObjectPosition(obj,0,0,0)
SetObjectRotation(obj,-90,0,0)
PlayObjectAnimation(obj,GetObjectAnimationName(obj,1),0,-1,1,0)
SetObjectAnimationSpeed(obj,0)
// some additional media creation
bg = CreateSprite(0)
SetSpriteColor(bg,40,40,40,100)
SetSpriteSize(bg,1024,768)
SetPrintSize(20)
meshtxt = CreateText("TEST")
SetTextPosition(meshtxt,20,40)
SetTextSize(meshtxt,12)
bonetxt = CreateText("TEST")
SetTextPosition(bonetxt,240,40)
SetTextSize(bonetxt,12)
animtxt = CreateText("TEST")
SetTextPosition(animtxt,500,40)
SetTextSize(animtxt,12)
childtxt = CreateText("TEST")
SetTextPosition(childtxt,800,40)
SetTextSize(childtxt,12)
// find textures
children = GetObjectNumChildren(obj)
if children>0
for i=1 to children
cid = GetObjectChildID(obj,i)
texturename$ = Lower(GetStringToken(GetObjectName(cid),"_",1))+".png"
if GetFileExists(texturename$)=1
image = LoadImage(texturename$)
SetObjectImage(cid,image,0)
else
SetObjectColor(cid,random(100,255),random(100,255),random(100,255),255)
endif
next i
endif
// dummy on each bone
bones = GetObjectNumBones(obj)
if bones>0
for i=1 to bones
x# = GetObjectBoneWorldX(obj,i)*1000
y# = GetObjectBoneWorldY(obj,i)*1000
z# = GetObjectBoneWorldZ(obj,i)*1000
box = CreateObjectBox(1,1,1)
SetObjectPosition(box,x#,y#,z#)
SetObjectColor(box,255,0,0,255)
next i
endif
do
Print("[Tab] to toggle settings, mouse to move viewport")
if GetRawKeyPressed(9)
vis = GetSpriteVisible(bg)
SetTextVisible(meshtxt,1-vis)
SetTextVisible(bonetxt,1-vis)
SetTextVisible(animtxt,1-vis)
SetTextVisible(childtxt,1-vis)
SetSpriteVisible(bg,1-vis)
endif
meshes = GetObjectNumMeshes(obj)
txtmesh$ = "Meshes: "+str(meshes)+chr(10)
if meshes>0
for i=1 to meshes
txtmesh$ = txtmesh$ + str(i)+". '"+GetObjectMeshName(obj,i)+"'"+ chr(10)
next i
endif
SetTextString(meshtxt,txtmesh$)
bones = GetObjectNumBones(obj)
txtbones$ = "Bones: "+str(bones)+chr(10)
if bones>0
for i=1 to bones
txtbones$ = txtbones$ + str(i)+". '"+GetObjectBoneName(obj,i)+"'" + chr(10)
next i
endif
SetTextString(bonetxt,txtbones$)
animations = GetObjectNumAnimations(obj)
txtanim$ = "Animations: "+str(animations) + chr(10)
if animations>0
for i=1 to animations
txtanim$ = txtanim$ + str(i)+". '"+GetObjectAnimationName(obj,i)+"'"+" Dur: "+str(GetObjectAnimationDuration(obj,GetObjectAnimationName(obj,i))) + chr(10)
next i
endif
SetTextString(animtxt,txtanim$)
children = GetObjectNumChildren(obj)
txtchild$ = "Children: "+str(children) + chr(10)
if children>0
for i=1 to children
txtchild$ = txtchild$ + str(i)+". "+"Name: '"+GetObjectName(GetObjectChildID(obj,i))+"'"+chr(10)
next i
endif
SetTextString(childtxt,txtchild$)
ControlCamera()
Print( ScreenFPS() )
Sync()
loop
function ControlCamera()
global startx#
global starty#
global angx#
global angY#
global mdis#
if mdis#=0.0 then mdis#= 100.0
// rotate the camera
if GetPointerPressed()=1
startx# = GetPointerX()
starty# = GetPointerY()
angx# = GetCameraAngleX(1)
angy# = GetCameraAngleY(1)
endif
if GetPointerState()=1
fDiffX# = (GetPointerX() - startx#)
fDiffY# = (GetPointerY() - starty#)
newX# = angx# + fDiffY#
if ( newX# > 89 ) then newX# = 89
if ( newX# < -89 ) then newX# = -89
SetCameraRotation( 1, newX#, angy# + fDiffX#, 0 )
endif
mdis# = mdis# - GetRawMouseWheelDelta()
if mdis#<12.0 then mdis#=12.0
if mdis#>200.0 then mdis#=200.0
SetCameraPosition(1,0.0,0.0,0.0)
MoveCameraLocalZ(1,-mdis#)
SetCameraLookAt(1,0.0,0.0,0.0,0)
endfunction
my test fbx fbx is also attached.