I'm trying to fix that awful "bug" in Maya whereby if you extract or seperate faces from an object with multiple materials on it, the newly extracted object has connections to all the same materials, even though it may only use ONE of those materials.
This problem is causing us big problems with some of our models and combining them into a single object is actually causing Maya to crash is some cases. However, if we apply ONE material to the objects before combining it's fine (and about 4-6 minutes faster)... and there's only about 14 materials in the whole scene..?
What I want to do to fix this problem (and as it happens an older one I gave up on) is to disconnect or disassociate any object with shaders it isn't actually using... eg:
I have a mesh object (polySurfaceShape1) that consists of ONLY ONE QUAD. it has NO history or intermediates or anything else...
If I type this:
listSets -o polySurfaceShape1;
I get:
// Result: lambert2SG lambert3SG lambert4SG lambert5SG
(because the cube I extracted it from earlier had FOUR materials on it)
If I type:
listSets -o polySurfaceShape1.f[0];
I get:
// Result: lambert4SG
(which IS actually the only material on the object)
So I thought I'd do this:
sets -remove lambert2SG polySurfaceShape1;
sets -remove lambert3SG polySurfaceShape1;
sets -remove lambert5SG polySurfaceShape1;
which, needless to say does absolutely nothing.
Can anyone tell me why?, or if there's a better way to solve this problem...? bear in mind that my objects may have MORE than a single material on, so I can't just re-apply the correct material to it.. (which does fix this problem as it happens)..
:nathaN