Here's what I use when I need to swap out the material on a Collada at runtime:
for each (var materialData:MaterialData in instance.materialLibrary) {
materialData.material = newMaterial;
}
On Wed, 10 Feb 2010 09:26:17 -0800, kensuguro <[email protected]> wrote:
I'm loading a dae and changing some textures of a particular object
within the scene at runtime. I can get to the mesh just fine, and I
can assign a new material to it... but even though the mesh's
material property is correctly set to the one I assigned, since the
individual faces' material is still the old one, the change doesn't
take effect.
So this makes me think, do I have to manually iterate over all faces
to change a material? Seems very inefficient...
I have an animated texture (like 5 frames) that I need to swap out.
It's not like a movie, but more like different face expressions, so I
just need to assign them on demand.