MCPcopy Create free account
hub / github.com/ImageEngine/cortex / testUniformIndices

Method testUniformIndices

test/IECoreScene/TriangulateOp.py:218–228  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

216 self.assertEqual( m2["uv"].indices, IECore.IntVectorData( [ 0, 3, 1, 0, 1, 2 ] ) )
217
218 def testUniformIndices( self ) :
219
220 m = IECoreScene.MeshPrimitive.createPlane( imath.Box2f( imath.V2f( -4 ), imath.V2f( 4 ) ), divisions = imath.V2i( 2, 2 ) )
221 m["myString"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Uniform, IECore.StringVectorData( [ "a", "b" ] ), IECore.IntVectorData( [ 1, 0, 0, 1 ] ) )
222
223 m2 = IECoreScene.TriangulateOp()( input = m, copyInput = True )
224
225 self.assertTrue( m2.arePrimitiveVariablesValid() )
226
227 self.assertEqual( m2["myString"].data, m["myString"].data )
228 self.assertEqual( m2["myString"].indices, IECore.IntVectorData( [ 1, 1, 0, 0, 0, 0, 1, 1 ] ) )
229
230
231 @unittest.skipUnless( os.environ.get("CORTEX_PERFORMANCE_TEST", False), "'CORTEX_PERFORMANCE_TEST' env var not set" )

Callers

nothing calls this directly

Calls 4

createPlaneMethod · 0.80
PrimitiveVariableMethod · 0.80
TriangulateOpMethod · 0.80

Tested by

no test coverage detected