Hi there.
Once I created a useful function for sketshup collada,
it get the loaded texture (created in the away pipeline)  by the name
of the jpg file :
on load complete :
var material1:IMaterial = (e.loader.handle as
Object3D).materialLibrary.getTextureByName("Textur18.jpg"))
etc...

the function is to create in the MaterialLibrary class (Loader.utils):

public function getTextureByName(id:String):IMaterial
        {
                        var materialName:Array =new Array();
                        var materialType:Array =new Array();
                for each (_materialData in this)
                        {
                                
materialName.push(_materialData.textureFileName);
                        }
                for each (_materialData in this)
                        {
                                materialType.push(_materialData.material);
                        }
                        return materialType[materialName.indexOf(id)];
        }


Once you get the materials,
you can iterate trough the faces and check wisch material it use:
var yourObject:Mesh = ObjectContainer(e.loader.handle).children[0] as
Mesh;// if you only have one object
 for(j=0;j<yourObject.faces.length-1;j++)
                                   {
                                     var face:Face = phono.faces[j] as Face;
                                    if (face.material = material1) do that();
 }

Hope this can help !


Reply via email to