Dag Woes...

I am having a hard time understanding how Maya works under the hood.
Somehow I am losing all my material assignments between sessions, even though the graph has not visibility changed on the surface.

When I set up my scene, all the materials are present, but when I save and reload the file, all the materials are gone and the shadingGroups are empty. The groups still have their input and output connections to the mesh nodes, but everything else is gone.

Here is what I'm doing in a nutshell...

Take a model with half a dozen materials on it, and some color sets. Duplicate the model. Create a polyColorMod node and blendColorSet node.

Feed the original object into the polyColorMod (outMesh > inputPolymesh), feed the polyColorMod into the blendColorSet node (output > inputPolymesh) and feed the output of the blendColorSet into the duplicate object (output > inMesh).

Finally, I change the input mesh into an intermediate object.

So what I have is basically bookends around some color set modifications. One each side is the same set of geometry, materials, and colorsets. This allows me to paint and edit the mesh on the input side, tweak some colorSet data and see the results live on the ouput Mesh.

All of this works fine until I save the scene and re-open....the shading groups only remember their assignment to the input polymesh, and the ouput mesh has lost all its shading data. Before saving the scene, I can query the shadingGroups and see that they're are affecting identical lists of faces on each mesh, but when I open the scene, only the input mesh remembers its materials.

What version of maya?

Anyway does not sound like dag issue.

QUOTE
so what I have is basically bookends around some color set modifications. One each side is the same set of geometry, materials, and colorsets. This allows me to paint and edit the mesh on the input side, tweak some colorSet data and see the results live on the ouput Mesh.

when you paint color sets maya switches a vertex color mode on. Whan you load it up maya DOES NOT switch this mode back on so once you re enter painting the stes it should resume.

Also if you fererence thiongs strategically the changes will be erased.

I am using Maya 8.5.

I am doing something which Maya does not like and I do chalk it up to me being ignorant of the DG and assuming what maya should do.

Anyway, its not a display setting. when I re-open my file i query the shadingGroups and they do not include the output mesh faces, thus the mesh draws as a wireframe even in shaded view. the input mesh does still have the shader assignments, when I change it's status as an intermediate object to OFF, it appears with the correct materials.

anyway, i'm trying to establish workflow with vertex color sets, whereby i combine them and modify them using nodes (namely the polyColorMod and polyBlendColor nodes), and allow for geometry modifications upstream the mods.

the problem i continue to run into however is the output mesh downstream of the vertex color mods ends up with scrambled shader assignments.

So i've isolated my problem to when I connect the output from my blendColorSets to my target mesh....

connecting blendColorSets1.output to pSphere1Shape.inputMesh causes the shading groups to empty out.
The shading groups are still connected to the target mesh, the DG graph doesn't change, but when I query the shading sets, they are empty.

I can re-assign the materials to my mesh, but then Maya inserts a bunch of groupId and groupPart nodes in between the blendColorSets and output mesh.

So basically, by trying to manually create a chain of DG nodes, I'm not setting up the groupPart nodes needed to preserve the shader information.

Any ideas on how to manage and build DG streams from scratch?
Thanks.