Babylon.js: AssetsManager doesn't clear loaded tasks

Created on 11 Jan 2018  路  16Comments  路  Source: BabylonJS/Babylon.js

Hello :)

AssetsManager doesn't clear loaded tasks. here is a playground that reproduces this wierd behavior
screen shot 2018-01-11 at 20 18 00
*Of course assetsManager.reset() solve the issue
*I assume that 6s is enough to load the assets

Thanks!

enhancement rendering engine

All 16 comments

Hello, why do you want the assetsManager to clear the tasks? It should not do that. It's user data so it must be cleared by user (using reset)

Hi,
I don't see the tasks themselves as user data, but the loadedMeshes.
I'm building room designer, when ever a user is adding an item I fetch the asset.
The problem now is that everytime I request for new item I get all the old ones all over again.

May I ask for the reason why you've decided to implement it this way?

This is why we added reset() API. So you can decide to clear the tasks or not depending on your needs.

But this is perhaps to much and we should clear the successful tasks upon completion?

I think that as an infrastructure I would have started with the naive solution - clear every finished task (error / success) instead of the reset function.
If that's not enough abort (to stop pending requests), retry (to retry failed tasks) and reload (reload all tasks) can be added later.
But that's just me, guess you guys knows what's best for the community :)
Thanks again.

Edit:
sorry for closing and reopening the issue.

I think I will follow you on this one :)
I'll work on that asap (Or you may want to do a PR perhaps?)

I did the code. But I will use this PR to also add comments to the class
So I think I will be able to merge it this tuesday. Stay tuned ;)

Sorry for the delay, I'm on holiday in France and therefore less available.
That was quick! Thanks!

My pleasure!

Thanks again! that's really helpful!
Any idea when it will be available via npm?

Next update is aimed to be this Friday ( cc @RaananW )

Sorry to bug you about that but any updates about 3.2-alpha6?
Maybe you guys can update about releases in announcements?

This Monday:) I promise

@deltakosh thanks for the fix!
But here is another thing:
http://playground.babylonjs.com/#VA21EY

Only the first model is being loaded, but I would expect the assets manager to load them both - what do you guys think?

Maybe a simple "loadMeshTask" function can solve this all issue?

Thanks again :)

You are loading the model named t. Isn't it what you expected?

Oh.
I'm sorry but that's not the playground I wanted to send, here is a fixed version:
http://playground.babylonjs.com/#VA21EY#2

Ok gotcha, this is not supported, you have to launch load only after having added all tasks.

Was this page helpful?
0 / 5 - 0 ratings