Cannot parse obj with multiple meshes

Software: Away3D 4.x

Dolomite, Newbie
Posted: 23 June 2011 07:18 AM   Total Posts: 2

Hello,
whenever you create obj with multiple meshes using maya or 3d max exporters, the parser OBJParser will only parse the first mesh and will stop on it. Example: car with separate meshes for wheels will only parse and therefore render first wheel (if it was first in obj list of “o” objects).

When I went inside of OBJParser I noticed that translate() is only called once and it would only parese the first object in the list of _objects. I did add itteration there, to see what happens. The rest of meshes got succesfully parsed, however it would cause runtime error in render cycle.

Please, help me to understand how to use obj parser properly in situations with multiple meshes…

PS Exporting stuff from prefab, kills all the object/mesh data therefore producing one huge Mesh for every element in the scene

   

cbrown, Jr. Member
Posted: 24 June 2011 07:21 PM   Total Posts: 39   [ # 1 ]

I don’t know which development environment you are using, but I use the Flash CS5 IDE.  The following code works fine for me and my obj has over 300 separate meshes:

Loader3D.enableParser(OBJParser);
var 
_loader:Loader3D = new Loader3D();
var 
url:String "myObj.obj";
var 
_request:URLRequest = new URLRequest(url);
_loader.addEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete);
var 
_alc:AssetLoaderContext = new AssetLoaderContext(true"img");
_alc.overrideAbsolutePaths true;
_loader.load(_requestnull_alc);
_scene.addChild(_loader); 

function 
onResourceComplete(e:LoaderEvent):void{
     alert
("COMPLETE");

(FYI: the “img” reference above in new AssetLoaderContext() is the folder I stored my texture bitmaps in)

 Signature 
signature_image

whatever is good to know is difficult to learn

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X