Can I parse without AssetLibrary?

Software: Away3D 4.x

Francks, Newbie
Posted: 19 February 2013 05:09 PM   Total Posts: 10

Hi everybody,

I would know if it’s possible to parse a preloaded file OBJ (get from a String or ByteArray, etc..) without the schema using AssetLibrary. Something like this:

var mesh:Mesh = Parser.parse(the_obj_file_in_string);

Anyone know how?

Tks

   

paullaster, Newbie
Posted: 19 February 2013 08:14 PM   Total Posts: 20   [ # 1 ]

If I understand the question.  Yes.  Just look at what the assetlibrary is doing and take it from there.  I did something similar to what you are asking.  The asset library is good.  I just didn’t want two resourcemanagers in my project.

All the parser classes are publicly available. though you might run into namespace issues if you are using external libs.

away3d.loaders.parsers.*

var _parser : ParserBase = new ObjParser();

_parser.parseAsync( data, 100 );

thats from the top of my head.

Ohh and you still have to listen to parse events.

   

Francks, Newbie
Posted: 19 February 2013 08:39 PM   Total Posts: 10   [ # 2 ]

I did it but it doesn’t works too. I added a event listener to the ParserBase, and it have not got a response. :(

I used a ParserEvent.PARSE_COMPLETE, and its function isn’t called.

   

paullaster, Newbie
Posted: 20 February 2013 03:11 AM   Total Posts: 20   [ # 3 ]

I remember having to still listen to more than just COMPLETE.  Follow the asset library its in there and doing what you want.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X