Load 3DS asset loader issue

Software: Away3D 4.x

srj_codez, Newbie
Posted: 02 June 2013 07:35 AM   Total Posts: 4

Hi ,

I am trying to simply load a 3DS file. Downloaded from web.

It seems , these files have already textures mapped to it.. and I haven’t got those textures with me.. >

I just want to view the 3DS file and Apply my own textures to those geometries ..

This is my code :

 
_loader = new Loader3D();
_loader.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onModelLoaded);
_loader.load(new URLRequest(‘pool3.3DS’));


Error shown :

Error: Error #2032: Stream Error. URL: app:/DIVEBORD.TGA
at away3d.loaders::AssetLoader/onRetrievalFailed()  [/Users/robbateman/Documents/fdt5workspace/away3d-core-fp11/src/away3d/loaders/AssetLoader.as:423]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at away3d.loaders.misc::SingleFileLoader/handleUrlLoaderError()[/Users/robbateman/Documents/fdt5workspace/away3d-core-fp11/src/away3d/loaders/misc/SingleFileLoader.as:336]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()

>>>>>> As you can see , DIVEBORD.TGA is the asset , i don’t have and I don’t want actually.

Please suggest a way to simply load without texture map.. for the ones coming with assets assigned.
And if possible I would be glad if anyone could post a simple generalized code to load 3DS , Apply texture of my own choice..

* AIR application for Mobile Devices

 

   

Avatar
80prozent, Sr. Member
Posted: 04 June 2013 06:57 PM   Total Posts: 430   [ # 1 ]

Hi

I think you can use the AssetLoaderContext.includeDependencies = false to define that the Parser should not load any dependencys.

use it like this (code is not tested):

var loadingContext:AssetLoaderContext=new AssetLoaderContext();
loadingContext.includeDependencies=false;
_yourLoader3d.load(yourURLRequest,loadingContext); 

have a look at the examples on github. i think most of the examples that are loading objects, overwrite the loadet textures with embed ones.

Hope that helps

 

 Signature 

sorry…i hope my actionscript is better than my english…

   

Pierce, Jr. Member
Posted: 07 June 2013 06:48 PM   Total Posts: 40   [ # 2 ]

You can also try creating a fake texture with the correct name just to get it to load properly, then modify the material to fit your needs and save it out to a friendlier format.

   

Avatar
80prozent, Sr. Member
Posted: 07 June 2013 07:57 PM   Total Posts: 430   [ # 3 ]

actually you would have the same problem with all file formats that are using external textures. If the texture is not found, the parsers will check if you are listening for a LoaderEvent.LOAD_ERROR.
If you do not listen for the Event, the Parser will cause a RunTimeError.

So all you have to do is listen for LOAD_ERROR, and do nothing when it occurs. Than no RuntimeError will be caused.

Savest way to deal with this path issues, is to import your model into AwayBuilder, and export it with embed Textures. That should work without any problem.

 Signature 

sorry…i hope my actionscript is better than my english…

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X