You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to load external resource by using AssetLibrary.load before application initializing.
So, I made some kind of preload class.
Here is a problem.
After loading multiple 3d resources, I tried to find assets by AssetLibrary.getAsset().
AssetLibrary.load() doesn't have any 'name' parameter.
So, what i do is make instance of Loader3D and assign 'name',
and put it into AssetLibrary by addAsset().
Atfer that, in some other class, I try to found resource by getAsset('name').
Is there any good example for indexing resources that are already loaded in AssetLibrary?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
I'll answer this question, but please don't use the issue tracker as a support channel. Questions like these can be asked in the Away3D forum instead, at away3d.com/forum.
When you load something, that something is called a "resource" (i.e. a master file and any other file dependencies.) One resource may contain many assets. For instance, an OBJ resource (which is two files, file.obj and file.mtl) can contain for example four assets, mesh1, mesh2, material1, material2.
The AssetLibrary doesn't care about resources, it cares about assets. Actually, you shouldn't be caring about resources either, because where the assets came from is rarely (if ever) relevant in your application logic.
So if you load a resource with AssetLibrary, the way to then retrieve a single asset from that resource is using that asset's name. The name is taken from within the file, which probably means that it was chosen by your artist.
If you really want to "tag" all the assets in a resource as you load them, load them into a separate namespace using the AssetLibrary.load() fourth parameter. You can then retrieve all the assets from that namespace using the AssetLibrary.createIterator() method.
If you need to further discuss this or have any further questions, please start a thread in the forums and refer to this issue with a link.
this is related a litte bit with issue #37.
I want to load external resource by using AssetLibrary.load before application initializing.
So, I made some kind of preload class.
Here is a problem.
After loading multiple 3d resources, I tried to find assets by AssetLibrary.getAsset().
AssetLibrary.load() doesn't have any 'name' parameter.
So, what i do is make instance of Loader3D and assign 'name',
and put it into AssetLibrary by addAsset().
Atfer that, in some other class, I try to found resource by getAsset('name').
Is there any good example for indexing resources that are already loaded in AssetLibrary?
Thanks in advance.
The text was updated successfully, but these errors were encountered: