Keeping Material Assignment sycned in history (Maya+MEL)

I’m working out a system whereby I can take a mesh to a certain point, convert it to an intermediate polyShape such that any new history afterwards is persistent. Therefore any future edits to the polyMesh topology take place before anything adding after the mesh was converted to an intermediate shape.

To help clarify:

polySphere > createColorSet > pSphere1 > polyColorMod > mesh

The idea is any changes to the object would happen on pSphere1 (splitting faces, merging vertices, etc.) and when I delete history I only clear out history upstream from pSphere1, maintaining my polyColorMod.

the problem I have is that pSphere1 can have multiple materials assigned to it. I want all the material assignment to be done on pSphere1 rather than mesh. I want mesh to inherit the shader assignments from pSphere1.

So mesh needs to send its list of faces to the shadingGroups, but that list of faces needs to coincide with pSphere1 and this currently is not the case. Currently when I make topology changes on pSphere1, they propagate correctly down to mesh, but the shaders get scrambled. So the set membership of the shadingGroups on mesh are getting out of whack.

hmm… I have a similiar sort of problem but with extracting faces by their shading group assignments.
Due to how the polyChipOff and polySeparate functions work.

Not allowing you to chip-off elements to a new mesh without the current model facelists being reordered.
polySeparate not allowing me to separate a given list of faces i.e. it only works on an object not a component list and looks for mesh data that apparently has broken edges…

[QUOTE=rhexter;776]hmm… I have a similiar sort of problem but with extracting faces by their shading group assignments.
Due to how the polyChipOff and polySeparate functions work.

[/QUOTE]

What exactly are you trying to do there? That sounds like it should be simple enough. I gather you’re trying to do something other than just extract faces based on their shading groups?