Loading DAE/collada models in Away3D and adding textures later

Software: Away3D 4.x

TheBard, Newbie
Posted: 04 November 2013 02:16 PM   Total Posts: 8

I am very new to Away3D and I am trying to load an embedded DAE model in Away3D for the first time.  I am trying to load only the model and then apply the textures separately, but I’ve hit a snag because I am unable to extract the mesh from the loader:

I am using the following code to load the model:

//load model
    
var byteArray:ByteArray = new ModelClass ( ); 
    
loader3D = new Loader3D();      
   
    
loader3D.loadData(new XML(byteArray), new AssetLoaderContext(false), null, new DAEParser());
   
    
loader3D.addEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete); 

The AssetLoaderContext() is set to false so that I can add the textures separately later.

The onResourceComplete() function is now being called by the listener:

private function onResourceComplete(event:Event):void
    {
        
var obj:Object3D loader3D;
        
myMesh obj as Mesh;  
        var 
box:ObjectContainer3D = new ObjectContainer3D();
        
box.addChild(myMesh);
    

I am not sure how to get the mesh from the loader.  I am sure I must be doing it wrong.  The last line box.addChild(myMesh) returns an error because myMesh = null.

How do I get the mesh from the loader?

Using loader3D.getChild(0), I find that it returns null, so loader3D has no children

Is the model just not loading?

I know there are issues with the DAEParser in Away3D and I am using a fairly large Blender model exported as a DAE. Incidentally the model loads fine in Papervision3D!

Is there something obvious I have overlooked?

   

ttytto, Newbie
Posted: 05 November 2013 01:41 AM   Total Posts: 3   [ # 1 ]

export from 3d soft like blender to dae, then open in prefab and export to as3…

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X