def testUVIndices(self):
    verticesPerFace = IECore.IntVectorData([3])
    vertexIds = IECore.IntVectorData([0, 1, 2])
    p = IECore.V3fVectorData([imath.V3f(0, 0, 0), imath.V3f(1, 0, 0), imath.V3f(0, 1, 0)])
    uv = IECore.V2fVectorData([imath.V2f(0, 0), imath.V2f(1, 0), imath.V2f(0, 1)])
    uvIndices = IECore.IntVectorData([0, 1, 2])
    mesh = IECoreScene.MeshPrimitive(verticesPerFace, vertexIds, 'linear', p)
    mesh['uv'] = IECoreScene.PrimitiveVariable(IECoreScene.PrimitiveVariable.Interpolation.FaceVarying, uv, uvIndices)
    meshReversed = mesh.copy()
    IECoreScene.MeshAlgo.reverseWinding(meshReversed)
    self.assertEqual(meshReversed.interpolation, mesh.interpolation)
    for interpolation in IECoreScene.PrimitiveVariable.Interpolation.values.values():
        self.assertEqual(meshReversed.variableSize(interpolation), mesh.variableSize(interpolation))
    self.assertEqual(mesh.keys(), meshReversed.keys())
    self.assertEqual(mesh['P'], meshReversed['P'])
    self.assertEqual(meshReversed['uv'].data, mesh['uv'].data)
    self.assertEqual(list(meshReversed['uv'].indices), list(reversed(mesh['uv'].indices)))
def testUVIndices(self):
    verticesPerFace = IECore.IntVectorData([3])
    vertexIds = IECore.IntVectorData([0, 1, 2])
    p = IECore.V3fVectorData([imath.V3f(0, 0, 0), imath.V3f(1, 0, 0), imath.V3f(0, 1, 0)])
    uv = IECore.V2fVectorData([imath.V2f(0, 0), imath.V2f(1, 0), imath.V2f(0, 1)])
    uvIndices = IECore.IntVectorData([0, 1, 2])
    mesh = IECoreScene.MeshPrimitive(verticesPerFace, vertexIds, 'linear', p)
    mesh['uv'] = IECoreScene.PrimitiveVariable(IECoreScene.PrimitiveVariable.Interpolation.FaceVarying, uv, uvIndices)
    meshReversed = mesh.copy()
    IECoreScene.MeshAlgo.reverseWinding(meshReversed)
    self.assertEqual(meshReversed.interpolation, mesh.interpolation)
    for interpolation in IECoreScene.PrimitiveVariable.Interpolation.values.values():
        self.assertEqual(meshReversed.variableSize(interpolation), mesh.variableSize(interpolation))
    self.assertEqual(mesh.keys(), meshReversed.keys())
    self.assertEqual(mesh['P'], meshReversed['P'])
    self.assertEqual(meshReversed['uv'].data, mesh['uv'].data)
    self.assertEqual(list(meshReversed['uv'].indices), list(reversed(mesh['uv'].indices)))