Stopping parser from loading dependencies

Software: Away3D 4.x

Rasterizer, Member
Posted: 03 December 2012 10:16 PM   Total Posts: 69

Is there any way to instruct the AWD2Parser to not load any dependencies ? All I am interested in are the material names, I don’t need it to load them.

   

synkarius, Member
Posted: 04 December 2012 01:01 AM   Total Posts: 64   [ # 1 ]

How about this?

var alc:AssetLoaderContext = new AssetLoaderContext(false);
AssetLibrary.loadData(dataalcsomeString, new AWD2Parser()); 
   

Rasterizer, Member
Posted: 04 December 2012 12:40 PM   Total Posts: 69   [ # 2 ]

Thanks man.

   

Rasterizer, Member
Posted: 31 December 2012 11:56 AM   Total Posts: 69   [ # 3 ]

Sorry to resurrect this one.

I tried this.

var loader3d:Loader3D = new Loader3D(false);
loader3d.loadData(awdfilename, new AssetLoaderContext(false), null, new AWD2Parser());


However the darn thing still asks for the texture file at runtime.

What I expected was a simple awd file loading procedure but without loading anything else and even further, without the parser even creating any materials.

I believe that would be a feature that developers would welcome, as it allows for more control over resources. Simply let the parser give us the INFO and stop it from acting upon that info automatically.

The way I envision this is to simply get the material name(s) from the AWD and the user’s asset manager class would take responsibility for loading that material definition and corresponding texture atlas before initializing the object.

So is there a way to achieve this right now or do I have to rewrite parts of AWD2Parser.as ?

   

Avatar
loth, Sr. Member
Posted: 02 January 2013 09:32 AM   Total Posts: 236   [ # 4 ]

personaly i don’t use material name but object name
AssetLibrary.enableParser(AWDParser);
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE,onAssetComplete);
AssetLibrary.loadData(new Model());

private function onAssetComplete(event : AssetEvent) : void {
  if (event.asset.assetType == AssetType.MESH) {
  var mesh : Mesh = event.asset as Mesh;
if(mesh.name==“truc”)...
}}

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X