Hi
My situation is like this:
I got an app that loads scene elements that are created by code. On top of that, I will like to load and reuse small assets and I mean a lot of times.
I do not use StandardMaterial at all. I moved everything to NodeMaterial. And here is my problem.
I got 1 model for assets and 2 textures for it separately.
I’m creating 3 tasks with AssetsManager. Put that in PromiseAll. On load I’m cloning NodeMaterial, assign textures to it, and put that on the model. Otherwise, I got “StandardMaterial not imported error” and I do not use it so I
All is fine but this is 1 asset that I will like to keep in memory and reuse.
But AssetContainer is not taking a single model to store it within. It takes all from the scene and I got their stuff that I do not want to add to it and do not want to add it to keep method. It’s too much of it. I need a method to add only this asset. And also it’s now in the scene, I need to remove it from it cause I’m not using it yet.
Also, I will load another asset like that in some time. Will also like to keep it. Do I need to create another AssetContainer and keep them in an object like this:
const assets = {
model1: assetsContainer1,
model2: assetsContainer2,
[...]
}
Or is there a better way to have the asset loaded along the way, but not put them in the scene until you need its instance (cause this is exactly what I need with this)?
Regards
Peter