royibernthal Posted August 30, 2016 Share Posted August 30, 2016 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) Quote Link to comment Share on other sites More sharing options...
jellix Posted August 30, 2016 Share Posted August 30, 2016 Hi, don't really know if this info is available. But if not, would a php-script be a solution to get the info that way? Quote Link to comment Share on other sites More sharing options...
royibernthal Posted August 30, 2016 Author Share Posted August 30, 2016 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. Quote Link to comment Share on other sites More sharing options...
jellix Posted August 31, 2016 Share Posted August 31, 2016 I have read about a progress event of the loader, so it handles file-sizes obviously. Sorry that I can't help further. Quote Link to comment Share on other sites More sharing options...
royibernthal Posted August 31, 2016 Author Share Posted August 31, 2016 I don't see a progress event: http://doc.babylonjs.com/classes/2.4/AssetsManager Regardless, thank you, hopefully someone else might know the answer. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 31, 2016 Share Posted August 31, 2016 Unfortunately we do not have this info in the AssetsManager Quote Link to comment Share on other sites More sharing options...
royibernthal Posted August 31, 2016 Author Share Posted August 31, 2016 22 minutes ago, Deltakosh said: Unfortunately we do not have this info in the AssetsManager Would you consider adding it? Quote Link to comment Share on other sites More sharing options...
reddozen Posted September 1, 2016 Share Posted September 1, 2016 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); } Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 2, 2016 Share Posted September 2, 2016 Why not using SceneLoader? Perhaps I do not understand the initial problem correctly Adding this information to the Asset Loader will be a big amount of work as the assets loader initialize multiple loads and has not an unique stream to manage Quote Link to comment Share on other sites More sharing options...
royibernthal Posted September 2, 2016 Author Share Posted September 2, 2016 SceneLoader seems a bit uncomfortable to me, I might be understanding it wrong though. Is there a way to pass urls to the SceneLoader in order to load both textures and meshes, similarly to how it's done in AssetsManager? Without creating a .babylon file / serializing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.