away3d/away3d-core-fp11 — Issue #228: Inconsistent Loading Events
Author: holmanelias
Created: 2012-02-27 07:15:47+00:00
State: open

I don't know if this should be classified as a bug per se, but different parsers seem to generate slightly different events, requiring code changes in the event handlers in order to process things consistently, and making it essentially impossible to do certain operations because of missing events.

For instance, I took the same Max model and exported it as 3DS and as OBJ. I have code that listens for onModelLoad events, and for the 3DS file for each texture map loaded, I get event.asset.assetType = AssetType.MATERIAL, and I am passed an appropriate subclass of DefaultMaterialBase. For the OBJ file, I get event.asset.assetType = AssetType.TEXTURE, and I am passed an appropriate subclass of Texture2DBase. In that case, I can't even access some of the properties I need such as alphaBlending because I am getting the Texture and not the Material, and there is no event fired for the Material itself. I think if anything, I would prefer to have things handled the way that the 3DS parser does it because I can always get the Texture from the Material when appropriate, and it just seems more logical, but maybe it makes more sense to fire both Material and Texture events.