I'm fairly new to Blender. I have a Cycles material in Blender 2.79. I'm using an Attribute node with COLOR_0 to get the vertex color and multiplying that into the material color. But if a particular mesh doesn't have the COLOR_0 attribute, it comes through black. Is there a node that can act as a switch based on presence of an attribute?
One way is to define a material where it will use a node comparing value of vertex colors for a factor defining what socket of the next node will be used.
There are 2 cubes and 2 different materials on them (for demonstration purposes). Both cubes have vertex color layer called "Col" (default name).
The color is fed to the Math node set to Less Than which compares values on the input to its second socket (which is 0.001, almost black, color will be black if no vertex color data is present).
Then the output of that is used as a factor for the MixRGB node - the output is either 0 or 1. If factor is 0 bottom input of the MixRGB node is used, If it's 1 - then the top one.
The cube on the right has Attribute node with vertex color layer written wrongly - "Col1" and blue color is used instead of default black. You can setup any color in the bottom input of the MixRGB node.