If we embed a obj files, but can not embed its .mtl file.
so when parse this obj file, it will load the mtl file.
I want we can embed all assets include mtl file,
can we?
How to embed mtl into swf as the same time obj embed?Software: Away3D 4.x |
||
liuyi, Member
Posted: 15 September 2011 02:14 AM Total Posts: 65 If we embed a obj files, but can not embed its .mtl file. so when parse this obj file, it will load the mtl file. I want we can embed all assets include mtl file, |
||
|
||
Fabrice Closier, Administrator
Posted: 31 August 2013 09:18 PM Total Posts: 1265 [ # 2 ] you cannot embed an mtl. Because the obj uses the “useMTL” tag to access the mtl, which holds the urls to the dependencies. As you would need to embed the dependencies as well, the mtl has no use. If you want to embed, simply load your obj with Prefab3D or AwayBuilder, and export as awd2 with the option “embed” on. Then once you have exported, simply embed this awd file. It will once you parse it (see examples) rebuild the object(s) with textures as in the original obj+mtl+dependencies. |
||
ActionFrob, Newbie
Posted: 01 September 2013 08:22 AM Total Posts: 10 [ # 3 ] Hi, my way to embed mtl is the following:
[Embed(source="assets/model.obj", mimeType="application/octet-stream")] And the function to load the OBJ contains the following:
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete); The function onAssetComplete then handles adding the Model to stage. Hope this helps! |