Newbie: AssetLibrary.loadData() throws stream error?

Software: Away3D 4.x

Hidden, Newbie
Posted: 14 March 2014 03:28 PM   Total Posts: 5

Im trying to load an embeded file.obj with AssetLibrary.loadData(), but it throws

[Fault] exception, information=Error: Error #2032: Stream Error. URL: app:/file.mtl

Could someone help please?

Heres my code:

[Embed(source="../stuff/logo.obj",mimeType="application/octet-stream")]
  
public var FileMesh:Class;
  
  private var 
_view:View3D;
  private var 
_mesh:Mesh;
  private var 
_loader:Loader3D;
  private var 
_color:ColorMaterial;
  
        public function 
Main()
        
{
   _view 
= new View3D();
   
_view.camera.= -200;
   
_view.camera.lookAt(new Vector3D());
   
   
AssetLibrary.enableParser(OBJParser);
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETEonAssetComplete);
      
AssetLibrary.loadData(FileMesh);
   
   
addChild(_view);
        
}
  
  
private function onAssetComplete(e:AssetEvent):void 
  {
   trace
("Asset complete");
  
   

Avatar
theMightyAtom, Sr. Member
Posted: 15 March 2014 09:02 AM   Total Posts: 669   [ # 1 ]

If a mesh in an .obj file has a bitmap material, the parser expects to find an .mtl file next to the .obj file, that defines the material.

To avoid this, either export your .obj file without materials, or make sure your software also exports a valid .mat file.

Good Luck!

   

Hidden, Newbie
Posted: 15 March 2014 11:25 AM   Total Posts: 5   [ # 2 ]

There was no material attached by my own to the mesh, but i used a svg, to extrude a mesh from it - that might have been the reason for a mtl file (as the svg came with the same color to blender, that i used in flash pro, when creating it) or blender used a default skin.

Anyway, blender didnt export a mtl, only an obj.

But thank you for lightning that up a little more!

   

Avatar
theMightyAtom, Sr. Member
Posted: 15 March 2014 09:13 PM   Total Posts: 669   [ # 3 ]

You could try taking it into AwayBuilder or Prefab. Then you can save it out in another format, AWD for example.
http://www.awaybuilder.com/

Cheers!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X