Been trying to do a way of automagically splitting meshes that are too large from an awd2 file into subgeometries.
So did a little test a cube 44, 44, 44 sub divisions from maya to awd2
private function assetComplete(e:AssetEvent):void
{
if (e.asset is Mesh)
{
if (Mesh(e.asset).geometry.subGeometries[0].numTriangles > 20000)
{
trace("Too many vertices.. Merging " + Mesh(e.asset).name);
var merge:Merge = new Merge(false, false);
var m:Mesh = new Mesh(Mesh(e.asset).material);
merge.apply(m, Mesh(e.asset))
Mesh(e.asset).parent.addChild(m)
Mesh(e.asset).parent.removeChild(Mesh(e.asset));
}
}
}
For some reason that only does 1 subG. No errors but part of the cube is missing.
Actually tried similar to the above in the awd2 parser parseMeshInstance() function did the same, only the first subg.
But if I use a basic away primitive it works fine.
I get 2 sub geometries
eg
var cube:Cube = new Cube(new BitmapMaterial(new BitmapData(256, 256, false, 0xff0000)), 500, 500, 500, 44, 44, 44);
var merge:Merge = new Merge(false, false);
var m:Mesh = new Mesh(cube.material);
merge.apply(m, cube)
scene.addChild(m)
So erm what me missing? Does AWD2 exporter do something different?