Loading AWD File with submeshes

Software: Away3D 4.x

rustyk, Newbie
Posted: 20 March 2016 01:41 PM   Total Posts: 22

So when I got a chance to load up an AWD file with embedded textures, only the first submesh is shown, there are 2.

I did not know this was a bit complicated, so how do you load or add the whole model to the scene?

I’m using the asset library as shown in the examples

if (e.asset.assetType == AssetType.MESH)
{
  _modelMesh 
e.asset as Mesh;
  
AssetLibrary.removeEventListener(AssetEvent.ASSET_COMPLETEonAssetReady);
   

rdoi, Member
Posted: 21 March 2016 04:43 PM   Total Posts: 86   [ # 1 ]

Afaik, all related submeshes are rectreated with the mesh by the awd parser, you don’t have to deal with them individually.

Anyway, I see in your code you are breaking (remove asset listener) the loading process when you get the first Mesh. I am not sure the awd parsing order, but with this you may be canceling the loading of further assets that your Mesh may need (submeshes included).
Try comenting out or move the asset removeListener to a RESOURCE_COMPLETE handler.

If this is not the case, make sure your awd file is exported correctly (open in awaybuilder/prefab), and post here all the loading related code, with some more details about the awd (v1/v2) structure.

   

rustyk, Newbie
Posted: 22 March 2016 12:22 AM   Total Posts: 22   [ # 2 ]

Ok thanks. Yes, I’m fairly new to away3d but I did get some basic info on how assetlibrary loading works by debugging and doing some trace. I was confused on how that event works but seems to be working now just need in getting used to handle asset loading.

Thanks again for the tip, made some changes on the RESOURCE_COMPLETE and working ok now! smile

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X