How to embed md5mesh and md5anim files to swf?

Software: Away3D 4.x

liuyi, Member
Posted: 19 October 2011 03:58 AM   Total Posts: 65

I want to embed all assets to one assets.swf

now I can load obj models,

I want use animation, so have to embed some md5 files.
But errors happened.

[Embed(source='../embeds/rider/idle.md5anim',mimeType 'application/octet-stream')]
private var _grRider:Class;

_assetsLib AssetLibrary.getInstance();
 
Parsers.enableAllBundled();
_assetsLib.loadData(_grRider); 


it show me need enable Parsers.enableAllBundled(), but I have enabled it.
Can I get a example, how to embed a md5mesh and md5anim ?

 

   

kornwaretm, Newbie
Posted: 19 October 2011 04:28 AM   Total Posts: 21   [ # 1 ]

don’t forget the 4th parameter smile
AssetLibrary.loadData(embededByteArray,null,null,new MD5MeshParser());

   

liuyi, Member
Posted: 19 October 2011 04:48 AM   Total Posts: 65   [ # 2 ]

Yes, I used this.
and MD5MeshParser throw a lots of error:
Error: Unknown keyword at line 4, character 10.
at away3d.loaders.parsers::MD5MeshParser/sendUnknownKeywordError()[E:\work\ghostRider2\git\sony-ghostrider2\game\prototype-v3\lib\away3d\loaders\parsers\MD5MeshParser.as:594]
at away3d.loaders.parsers::MD5MeshParser/proceedParsing()[E:\work\ghostRider2\git\sony-ghostrider2\game\prototype-v3\lib\away3d\loaders\parsers\MD5MeshParser.as:160]

[Fault] exception, information=Error: Unknown keyword at line 4, character 10.
Fault, MD5MeshParser.as:594
[Fault] exception, information=Error: Unknown keyword at line 5, character 0.
Fault, MD5MeshParser.as:594

   

kornwaretm, Newbie
Posted: 19 October 2011 05:23 AM   Total Posts: 21   [ # 3 ]

this is the place where the error thrown. you can check yourself at away3d/loaders/parsers/MD5MeshParser.as

...........
/**
 * Throws an error when an unknown keyword was encountered.
 */
private function sendUnknownKeywordError() : void
{
 
throw new Error("Unknown keyword at line " + (_line 1) + ", character " _charLineIndex ". ");
}
........... 

basically the file will spitted to tokens of vertex triangle etc and this indicate the mesh file is maybe
1. somehow broken (try to reexport)
2. using different version of md5Mesh or wrongly exported.
  update the exporter and find a good documentation of it,
  or may be try another exporter if exist.

btw i’m using blender and md5exporter and this is my code
AssetLibrary.enableParser(MD5MeshParser);
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, putmesh);
AssetLibrary.loadData(creq.bayte,null,null,new MD5MeshParser());
this works great

hope this help

 

   

liuyi, Member
Posted: 19 October 2011 05:40 AM   Total Posts: 65   [ # 4 ]
kornwaretm - 19 October 2011 05:23 AM

this is the place where the error thrown. you can check yourself at away3d/loaders/parsers/MD5MeshParser.as

...........
/**
 * Throws an error when an unknown keyword was encountered.
 */
private function sendUnknownKeywordError() : void
{
 
throw new Error("Unknown keyword at line " + (_line 1) + ", character " _charLineIndex ". ");
}
........... 

basically the file will spitted to tokens of vertex triangle etc and this indicate the mesh file is maybe
1. somehow broken (try to reexport)
2. using different version of md5Mesh or wrongly exported.
  update the exporter and find a good documentation of it,
  or may be try another exporter if exist.

btw i’m using blender and md5exporter and this is my code
AssetLibrary.enableParser(MD5MeshParser);
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, putmesh);
AssetLibrary.loadData(creq.bayte,null,null,new MD5MeshParser());
this works great

hope this help

Thanks! the md5mesh can be load by loader3D.
I loaded it by loader3D before.
what’s creq.bayte?


[Embed(source=’../embeds/rider/idle.md5anim’,mimeType = ‘application/octet-stream’)]
private var _grRider:Class;
AssetLibrary.loadData(grRider,null,null,new MD5MeshParser());

or AssetLibrary.loadData(new grRider(),null,null,new MD5MeshParser());

get the same error.

 

   

liuyi, Member
Posted: 19 October 2011 05:43 AM   Total Posts: 65   [ # 5 ]

I found I can load the hellknight.md5mesh (from the git example).
Maybe is the model’s reason.
But it can be loaded by loader3D.
so strange.

Thanks! kornwaretm!

   

liuyi, Member
Posted: 19 October 2011 06:06 AM   Total Posts: 65   [ # 6 ]

It’s my fault, I load a .md5anim instead of .md5mesh
..
so stupid….

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X