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_COMPLETE, onLoadShipComplete);
_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.