MD5MESH load issue. I have enabled all parsers, but it show me error. Error: No parser defined. T

Software: Away3D 4.x

liuyi, Member
Posted: 19 October 2011 02:59 AM   Total Posts: 65

I have enabled all parsers, but it show me error .

protected function initLoader():void {
   Parsers
.enableAllBundled();
   
   
_assetsLib AssetLibrary.getInstance();
   
_assetsLib.addEventListener(LoaderEvent.RESOURCE_COMPLETEmodelLoaded);
   
_assetsLib.addEventListener(AssetEvent.ASSET_COMPLETEassetLoaded);
   
_assetsLib.addEventListener(LoaderEvent.LOAD_ERROR,onLoadError)
  

Error: No parser defined. To enable all parsers for auto-detection, use Parsers.enableAllBundled()
at away3d.loaders.misc::AssetLoaderToken/onLoaderEvent()[E:workghostRider2gitsony-ghostrider2gameprototype-v3libaway3dloadersmiscAssetLoaderToken.as:81]
at flash.events::EventDispatcher/dispatchEventFunction()

   

louis87, Jr. Member
Posted: 19 October 2011 06:47 AM   Total Posts: 46   [ # 1 ]

Can you show us the code when you load the mesh?

   

Richard Olsson, Administrator
Posted: 19 October 2011 09:19 AM   Total Posts: 1192   [ # 2 ]

Are you embedding the md5 file or loading it from an external source?

   

bakajin, Newbie
Posted: 29 March 2012 09:56 PM   Total Posts: 24   [ # 3 ]

I’m having a similar problem.

I’m trying to load a sequence of obj files.
So I’m loading them from an xml.
It doesn’t seem the Embed code like in the Basic_LoadObj example would be practical.

But when i pas the loader the path to the file(s) i get:

Error: No parser defined. To enable all parsers for auto-detection, use Parsers.enableAllBundled()

While the code states, just before it produces this error,

Parsers.enableAllBundled() already.
Anyone who can point me in the right direction?

 

   

Richard Olsson, Administrator
Posted: 30 March 2012 06:01 AM   Total Posts: 1192   [ # 4 ]

It’s up to each file-type parser to identify whether they recognize a file or not. If no parser claims it, this error would occur. Does your OBJ file have a file suffix that is “obj”? Is there an MTL file?

It would be great if you could file a bug on GitHub and upload your OBJ/MTL files somewhere and refer to them in the bug report.

   

bakajin, Newbie
Posted: 30 March 2012 11:52 AM   Total Posts: 24   [ # 5 ]

ic,

thanks for your quick reply.
It would seem i am coming to similar conclusions.

Now I’m passing my loader object that loaded the obj file url.
(I was thinking i would pass the url to the file as an urlrequest like).
       
Doing AssetLibrary.loadData(”/../somepath/to/the/file/meshFRAME_0.obj”);
Produces this parser error.

Doing AssetLibrary.loadData(contentLoader.getContent(“obj”)); //the completed loader

Produces a new error (but getting closer smile, related to a linked file

Error: Error #2032: Stream Error. URL: file:///C|/fla/meshFRAME_0.mtl

Problem being I am loading the obj files from an /embed dir not the fla dir.
It seems to link to an mtl from the obj file but cwd to the root dir instead of the same dir the obj came from.
(Where the mtl files also reside)

Not too sure if i really need the mtl file (would be easiest not to have to worry about it though)
I’ll have to do some reconstructing of the material from softimage to away3d anyway.
Plus i would assume uvs are stored in the mesh / obj file?

I think I will need some more research or tips before I file a bugreport.
Just to clarify I’m trying to set up a vertexanimation pipline. A python script in Softimage generates the obj files in a numbered sequence from (shape) animation keyframes. The awayd will load up all the frames and put them in a vertexAnimator (so i can go back and forth on the anims/look).

Nehoe, any pointers welcome, I am still a bit of a n00b.

Sorry for the thread hijack smile

O

   

bakajin, Newbie
Posted: 30 March 2012 04:14 PM   Total Posts: 24   [ # 6 ]

Ok so altering the path in the obj file fixed it.

I guess i will log a bug relating to the error message.
Should be more like cannot read file from url or somminck along those lines.

Then another bug for the reading of a path to the mtl from the obj file. Where really that looks like just the file name of the mtl.

Oddly enough i’ve downloaded and set up all the new flash player 11 stuff, debugger and playerglobal. But my test now just renders black and AWstats says 0 polys. Some checking reveals that also some demos online produce this behaviour. What gives? Or maybe i should rather start a new thread on that.

   

Richard Olsson, Administrator
Posted: 31 March 2012 07:00 AM   Total Posts: 1192   [ # 7 ]

There isn’t really a bug here (although one could fairly argue that the erro message could be clearer, so feel free to file a request about that.)

An OBJ file often has a reference to an MTL file, and the framework will handle that dependency like it handles all other dependencies. It will resolve the URL using the URL of the main (OBJ) file. However, if you are embedding your OBJ file, it cannot resolve the URL, and will instead try the URL relative to the SWF.

What you need to do if you embed a file is to use the AssetLoaderContext APIs to remap the dependency URL, e.g. to an embedded version of the MTL file or to another URL.

If you are not embedding, this is probably happening because the OBJ file defines an “incorrect” (absolute) path to the MTL file. For local file exchange that’s ok, but for the web there’s no way to solve this but to edit the OBJ file.

   

bakajin, Newbie
Posted: 05 April 2012 02:33 PM   Total Posts: 24   [ # 8 ]

Thanks a million for that insight.

As far as bugs go, i agree.

Using an AssetLoaderContext defining the path fixed the problem.

My obj file had a path in it that really only described the filename of the mtl.
So loading the file and using an AssetLoaderContext fixed my problems.

Other problems seemed related to frustrumculling and camera control.

But I’m all set, thanks again and hope this is not too much of a thread hijack wink

Olivier

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X