Jump to content

Get size of loaded file when using AssetsManager


royibernthal
 Share

Recommended Posts

I'm using AssetsManager to load a list of files.

Is there a way to tell a loaded file's size? e.g. by the IAssetTask returned onTaskSuccess.

I'd like to avoid using SceneLoader as I'd need to create predefined .babylon files to load, and I'd like to avoid that. (assuming I understand SceneLoader properly)

Link to comment
Share on other sites

Hi,

PHP is really not needed for that, I'm talking about the file size after it finished downloading, pure client side should be enough to get that information.

I know that if I create my own functions for making file requests I can access the header "Content-Length" to find the file size, but I'd like to keep using the existing bjs AssetsManager.

As far as I know bjs returns file size in SceneLoader, I have yet to find a way to get it in AssetsManager.

Link to comment
Share on other sites

I'll steal this from another topic...

if you're loading serialized files, you don't need a *.babylon file to load the mesh with SceneLoader if you have it serialized or in JSON format somehow.

var serMesh = BABYLON.SceneSerializer.SerializeMesh(taskObject.assets.tiles, false, false);
serMesh = JSON.stringify(serMesh);
BABYLON.SceneLoader.ImportMesh("", "", "data:" + serMesh, scene, function (newMeshes) {
	console.log("newMeshes: " + newMeshes);
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...