Thank you ! I try the second solution you gave me and it works fine !
On 4 fév, 21:19, Fabrice3D <[email protected]> wrote: > access the materiaLiibrary or nullify the material at face level and apply. > materialLibrary.getMaterial("name"); > > but since its an Obj file, you also can alter by hand the obj file, remove > the "mtllib mtlname.mtl" line at top file and > remove all the "usemtl matname" most of the time located between VT and F > tags. in this case your code will work. > > Fabrice > > On Feb 4, 2010, at 9:02 PM, Flo711 wrote: > > > Hello, > > > I have loaded a mesh by doing : > > > object3DLoader = Obj.load("model.obj", {material:bitmapMaterial, > > name:"crist", scaling:30, x:0, y:0, z:0, loadersize:200}); > > > object3DLoader.addOnSuccess(onLoaderSuccess); > > > private function onLoaderSuccess(e:Loader3DEvent):void { > > > if(e.loader.handle is Mesh){ > > > mesh = e.loader.handle as Mesh; > > mesh.material= new ColorMaterial(); > > > } else { > > > } > > } > > > But I can't figure how o acces the material to change it within the > > function onLoaderSuccess. > > when I trace(mesh.material) I get null before doing : mesh.material= > > new ColorMaterial();
