multi-layered texturing / multiple vertex color sets

does unity support multi-layered texturing?
can i read multiple vertex color sets/layers?

i believe fbx does support this.
maya does support this.

thanks,

found some documentation and another thread
documentation reads…

"For every vertex there can be a normal, two texture coordinates, color and tangent. These are optional though and can be removed at will. All vertex information is stored in separate arrays of the same size, so if your mesh has 10 vertices, you would also have 10-size arrays for normals and other attributes. "

so the answer in short is “no”.

but can you override the mesh data arrays.?
can you double up the data in the arrays that are read in a custom way though the shader?
will this work with fixed function or strumpy?

I needed two sets of vertex colors on my models for my current project; so I decided to use COLOR and TEXCOORD0(xy=rg)+TEXCOORD1(x=b) for my two sets.

To make it possible to see and paint the second set of vertex colors I created a little python script for Blender which allows me to tap Ctrl+Shift+F1 to quickly swap vertex colors with UV coordinates.

Just posting here in case this is of use to anybody; I was unable to find any existing scripts to achieve this.

# LICENSE: MIT

import bpy

bl_info = {
    'name': 'Swap Vertex Colors with UVs',
    'author': 'numberkruncher',
    'version': (0, 1),
    'blender': (2, 7, 7),
    'description': 'Swaps vertex color data with uv1/uv2 data',
    'category': 'Vertex Paint'
}

class SwapVertexColorsWithUVs(bpy.types.Operator):
    bl_label = "Swap Vertex Colors with UVs"
    bl_idname = "object.swap_vertex_colors_with_uvs"
    bl_description = "Swaps vertex color data with uv1/uv2 data"
 
    def execute(self, context):
        self.report({'INFO'}, "Swapping vertex color data with uv1/uv2 data")
        
        # start in object mode
        obj = context.scene.objects.active
        mesh = obj.data

        # make sure that the object has vertex colors
        if not mesh.vertex_colors:
            mesh.vertex_colors.new()
        # make sure that the object has uv data
        while len(mesh.uv_textures.values()) < 2:
            mesh.uv_textures.new()

        # grab the active vertex color data layer
        color_layer = mesh.vertex_colors.active  
        # grab the active uv data layer
        uv_layers = mesh.uv_layers.values()

        i = 0
        for poly in mesh.polygons:
            for idx in poly.loop_indices:
                tempR = color_layer.data*.color.r*

tempG = color_layer.data*.color.g*
tempB = color_layer.data*.color.b*
#tempA = color_layer.data*.color.a*

color_layer.data.color.r = uv_layers[0].data*.uv.x*
color_layer.data.color.g = uv_layers[0].data*.uv.y*
color_layer.data.color.b = uv_layers[1].data*.uv.x*
#color_layer.data.color.a = uv_layers[1].data*.uv.y*

uv_layers[0].data*.uv.x = tempR*
uv_layers[0].data*.uv.y = tempG*
uv_layers[1].data*.uv.x = tempB*
#uv_layers[1].data*.uv.y = tempA*

i += 1

# set to vertex paint mode to see the result
bpy.ops.object.mode_set(mode=‘VERTEX_PAINT’)

return {‘FINISHED’}

def register():
bpy.utils.register_class(SwapVertexColorsWithUVs)
bpy.context.window_manager.keyconfigs.active.keymaps[‘Vertex Paint’].keymap_items.new(‘object.swap_vertex_colors_with_uvs’,value=‘PRESS’,type=‘F1’,ctrl=True,alt=False,shift=True,oskey=False)

def unregister():
bpy.utils.unregister_class(SwapVertexColorsWithUVs)

if name == “main”:
register()