Hi, For any advice or direction on this I would be supremely grateful:
I’m trying to modify the ColorMaterial for a mesh extracted from loading the asd class generated (essentially) from Prefab3D as below.
var myClass:MyClass=new MyClass();
var v:Vector.<Mesh>=myClass.meshes;
var m:Mesh=v[0];
m.material=new ColorMaterial(0x00FF00,.5);
view.scene.addChild(m);
Why isn’t the myClass now green?
This works fine on meshes from awd2 files that I load.
I’m also trying to change the lightpicker and specular of the materials with no result.
This also (unsurprisingly) has no effect:
for each (subMesh in m)
{
subMesh.material=new ColorMaterial(0x00FF00,.5);
subMesh.material.lightPicker=staticLightPicker;
ColorMaterial(subMesh.material).specular=.1;
}
Should I simply go back to to using awd2 files?
Incidentally I’ve been generating my awd2 files using AwayBuilder rather than Prefab because the AwayBuilder awd2 files are about half the size (I assume because of their compression?), and I only need the meshes as I apply ColorMaterials on the fly. Being able to create asd style classes with only the mesh data would be fantastic and any advice on how to go about this would be extremely welcome.
Thank you for your consideration!