Simply saves various data from a 3D object into a text file at \Documents\AGK-text-export\object-settings.txt
ball = LoadObjectWithChildren ("ball.fbx")
saveObjectDataToFile (ball)
// This function saves data to Documents\AGK-text-export\object-settings.txt
function saveObjectDataToFile (objectRef)
// If the save folder doesn't exits, it will be created.
MakeFolder("raw:" + GetDocumentsPath () + "\AGK-text-export")
objectSaveFile = OpenToWrite( "raw:" + GetDocumentsPath () + "\AGK-text-export\object-settings.txt" , 0)
WriteLine(objectSaveFile, "Target: " + GetObjectName( objectRef ) )
WriteLine (objectSaveFile, "")
WriteLine(objectSaveFile, "Number of Children: " + Str(GetObjectNumChildren( objectRef )))
WriteLine (objectSaveFile, "")
// Stuff to do: Loop through number of children.
// GetObjectChildID( objID, childIndex )
WriteLine(objectSaveFile, "Number of animations: " + Str(GetObjectNumAnimations( objectRef )))
for nrAnimations = 1 to GetObjectNumAnimations( objectRef )
WriteLine(objectSaveFile, "Animation " + Str(nrAnimations) + ": " + GetObjectAnimationName( objectRef, nrAnimations ) + " Duration: " + str(GetObjectAnimationDuration( objectRef, GetObjectAnimationName( objectRef, nrAnimations ) )))
next
WriteLine (objectSaveFile, "")
WriteLine(objectSaveFile, "Number of bones: " + Str(GetObjectNumBones( objectRef )))
for nrBones = 1 to GetObjectNumBones( objectRef )
WriteLine(objectSaveFile, "Bone number " + Str(nrBones) + ": " +GetObjectBoneName( objectRef, nrBones ))
next
WriteLine (objectSaveFile, "")
CloseFile(objectSaveFile)
endfunction