Issues with new 3DS parser and tga texture

Software: Away3D 4.x

Leo Bergman, Newbie
Posted: 25 October 2011 05:15 AM   Total Posts: 4

After updating to the latest version of away3d-core-fp11 I cannot seem to get the 3DS parser to work with one of the models I’m using.

I want to have the textures embedded, and was using the following code previously:

var assetLoaderContext:AssetLoaderContext = new AssetLoaderContext();
_ship = new Loader3D();
_ship.addEventListener(AssetEvent.ASSET_COMPLETEonLoadShipComplete);
_ship.loadData(new Ship(), new Max3DSParser(), assetLoaderContext); 

“Ship” is the embedded Class for the model I’m using.

I have converted the textures to png, embedded them and set them in “onLoadShipComplete” like this:

var mesh:Mesh e.asset as Mesh;
var 
bodyFileMaterial:BitmapFileMaterial = new BitmapFileMaterial();
bodyFileMaterial.bitmapData = new ShipMatC().bitmapData;
bodyFileMaterial.specularMap = new ShipMatS().bitmapData;
[...]
mesh
.material bodyFileMaterial

The worked fine until updating to away3d-away3d-core-fp11-d4e2dc7. After changing the order of arguments for “loadData” I now get the following error:

Error: Error #2032: Stream Error. URL: S_1024_C.TGA
at away3d.loaders::Loader3D/onLoadError()[D:_devSpecRsrcaway3dloadersLoader3D.as:174]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at away3d.loaders.misc::AssetLoaderToken/onLoaderEvent()[D:_devSpecRsrcaway3dloadersmiscAssetLoaderToken.as:78]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at away3d.loaders::AssetLoader/onRetrievalFailed()[D:_devSpecRsrcaway3dloadersAssetLoader.as:296]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at away3d.loaders.misc::SingleFileLoader/handleUrlLoaderError()[D:_devSpecRsrcaway3dloadersmiscSingleFileLoader.as:236]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()

Mapping the texture URL to the embedded resource using “assetLoaderContext.mapUrlToData”, or adding the tga to the directory of the published swf, results in the following error:

Error: No parser defined. To enable all parsers for auto-detection, use Parsers.enableAllBundled()
at away3d.loaders::Loader3D/onLoadError()[D:_devSpecRsrcaway3dloadersLoader3D.as:174]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at away3d.loaders.misc::AssetLoaderToken/onLoaderEvent()[D:_devSpecRsrcaway3dloadersmiscAssetLoaderToken.as:78]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at away3d.loaders::AssetLoader/onRetrievalFailed()[D:_devSpecRsrcaway3dloadersAssetLoader.as:296]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at away3d.loaders.misc::SingleFileLoader/parse()[D:_devSpecRsrcaway3dloadersmiscSingleFileLoader.as:300]

Setting “assetLoaderContext.includeDependencies” to false results in the following error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at away3d.loaders.parsers::Max3DSParser/finalizeCurrentMaterial()[D:_devSpecRsrcaway3dloadersparsersMax3DSParser.as:532]
at away3d.loaders.parsers::Max3DSParser/proceedParsing()[D:_devSpecRsrcaway3dloadersparsersMax3DSParser.as:115]
at away3d.loaders.parsers::ParserBase/onInterval()[D:_devSpecRsrcaway3dloadersparsersParserBase.as:305]
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()

Let me know if you like me to file a bug report and/or provide the model used.

   

Richard Olsson, Administrator
Posted: 25 October 2011 06:48 AM   Total Posts: 1192   [ # 1 ]

The first error is because the 3DS file is referencing the texture in a location where Flash Player could not load it from (e.g. because it’s not there.) The second error is because there is no parser in the framework which can handle TGA files.

The third error on the other hand seems like it’s a bug. Please upload your 3DS file in a ZIP, and file a bug on GitHub referencing this thread or the zip file if hosted elsewhere.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X