Away3D - load DAE file via Loader3D

Hello,
did anyone manage to load .DAE with the use of Loader3D. If yes, could someone please add some working example.
Loader3D works fine with 3ds files, but in case of .DAE I still receive only empty containers - neither mesh nor animation.

The only examples I found are with the use of Asset3DLibrary.loadData, but the class produces errors all over the place (even with other file formats) and it seems there is no documentation for it.

I would be glad is someone could share his/her experience - that would definitely help people who try to keep Away3D alive.

I’m actively using Away3D and DAE files with the Loader3D.

//first import outside your class:

import away3d.loaders.Loader3D;
import away3d.loaders.parsers.DAEParser;
import away3d.loaders.misc.AssetLoaderContext;
import away3d.events.Asset3DEvent;
import away3d.entities.Mesh;
import away3d.library.assets.IAsset;
import away3d.library.assets.Asset3DType;
import away3d.loaders.misc.AssetLoaderToken;

//then in your class function…
Loader3D.enableParser(DAEParser);

var aLoader = new Loader3D(false);
var nameSpace = "nameSpace1";
var url = 'assets/models/themodel.dae';
//token nameSpace is useful for identifying assets after they are downloaded
var token = aLoader.load(new URLRequest(url),assetLoaderContext,nameSpace);
token.addEventListener(Asset3DEvent.ASSET_COMPLETE, function(event:Asset3DEvent){

				var asset:IAsset = event.asset;

				switch (asset.assetType)
				{
					case Asset3DType.MESH :
						var theMesh = cast(asset, Mesh);
						trace(asset.name+" mesh is loaded, "+asset.assetNamespace);
						//assuming you've set up a scene already…
						_view.scene.addChild(theMesh);
				}
});
3 Likes