So I exported a model in blender, sketchup and Prefab and they all do the same thing. They only add the first material on the whole mesh rather than different materials on the same mesh. My code is as follows:
[Embed(source="../lib/Models/GoalArena.obj", mimeType="application/octet-stream")]
public static var model:Class;
public static var arenaModel:Mesh;
public static function create():void {
Parsers.enableAllBundled();
createMaterial();
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, completeModel);
AssetLibrary.loadData(new model());
}
public static function completeModel(event:AssetEvent):void {
if (event.asset.assetType == AssetType.MESH) {
arenaModel = event.asset as Mesh;
arenaModel.geometry.scale(25);
arenaModel.x = -1000;
Scene.view.scene.addChild(arenaModel);
}else {
}
Should it be placing multiple materials on the mesh or just only the first single material? I’ve also tried different types such as as3 class (which is really cool) by exporting one in Prefab but it does the same thing.
When I do import my model in Prefab though, it imports it perfectly with all the textures and unjoined meshes.
So I’d really love some help. I’ve seen a few other people with my problem too but I still can’t find a fix. Thanks <3
Edit: Also, if Prefab can import it perfectly why can’t the object parser? That’s why I presume I’m doing something wrong.