def convertlistToOpenMayaArray(inList, arrayType):
    """convert given list to an openmaya arraytype

    :param inList: list of objects to be added to arraytype
    :type inList: list
    :param arrayType: any openmaya array type
    :type arrayType: OpenMaya.<array>
    :return: the array filled with data
    :rtype: OpenMaya.<array>
    """
    array = arrayType()
    for elem in inList:
        array.append(elem)
    return array