@staticmethod
def addVertex(sourceindex, v_map, sourcedata, destdata):
    """Add a vertex from source to destination. Returns index in
        destdata of the vertex."""
    try:
        return v_map[sourceindex]
    except KeyError:
        v_map[sourceindex] = destdata.num_vertices
        destdata.num_vertices += 1
        destdata.vertices.update_size()
        destdata.vertices[-1].x = sourcedata.vertices[sourceindex].x
        destdata.vertices[-1].y = sourcedata.vertices[sourceindex].y
        destdata.vertices[-1].z = sourcedata.vertices[sourceindex].z
        if sourcedata.has_normals:
            destdata.normals.update_size()
            destdata.normals[-1].x = sourcedata.normals[sourceindex].x
            destdata.normals[-1].y = sourcedata.normals[sourceindex].y
            destdata.normals[-1].z = sourcedata.normals[sourceindex].z
        if sourcedata.has_vertex_colors:
            destdata.vertex_colors.update_size()
            destdata.vertex_colors[-1].r = sourcedata.vertex_colors[sourceindex
                ].r
            destdata.vertex_colors[-1].g = sourcedata.vertex_colors[sourceindex
                ].g
            destdata.vertex_colors[-1].b = sourcedata.vertex_colors[sourceindex
                ].b
            destdata.vertex_colors[-1].a = sourcedata.vertex_colors[sourceindex
                ].a
        if sourcedata.has_uv:
            for sourceuvset, destuvset in zip(sourcedata.uv_sets, destdata.
                uv_sets):
                destuvset.update_size()
                destuvset[-1].u = sourceuvset[sourceindex].u
                destuvset[-1].v = sourceuvset[sourceindex].v
        return destdata.num_vertices
