def _mesh_to_material(mesh, metallic=.02, rough=.1):
    """
    Create a simple GLTF material for a mesh using the most
    commonly occurring color in that mesh.

    Parameters
    ------------
    mesh: Trimesh object

    Returns
    ------------
    material: dict, in GLTF material format
    """
    # just get the most commonly occurring color
    color = mesh.visual.main_color
    # convert uint color to 0-1.0 float color
    color = color.astype(float) / (2 ** (8 * color.dtype.itemsize))

    material = {'pbrMetallicRoughness':
                {'baseColorFactor': color.tolist(),
                 'metallicFactor': metallic,
                 'roughnessFactor': rough}}
    return material