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

Method testHash

test/IECoreScene/MeshPrimitive.py:213–243  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

211 self.assertEqual( m.maxVerticesPerFace(), 4 )
212
213 def testHash( self ) :
214
215 m = IECoreScene.MeshPrimitive( IECore.IntVectorData(), IECore.IntVectorData(), "linear", IECore.V3fVectorData() )
216 h = m.hash()
217 t = m.topologyHash()
218
219 m2 = m.copy()
220 self.assertEqual( m2.hash(), h )
221 self.assertEqual( m2.topologyHash(), t )
222
223 m.setTopology( IECore.IntVectorData( [ 3 ] ), IECore.IntVectorData( [ 0, 1, 2 ] ), "linear" )
224 self.assertNotEqual( m.hash(), h )
225 self.assertNotEqual( m.topologyHash(), t )
226 h = m.hash()
227 t = m.topologyHash()
228
229 m.setTopology( IECore.IntVectorData( [ 3 ] ), IECore.IntVectorData( [ 0, 2, 1 ] ), "linear" )
230 self.assertNotEqual( m.hash(), h )
231 self.assertNotEqual( m.topologyHash(), t )
232 h = m.hash()
233 t = m.topologyHash()
234
235 m.setTopology( IECore.IntVectorData( [ 3 ] ), IECore.IntVectorData( [ 0, 2, 1 ] ), "catmullClark" )
236 self.assertNotEqual( m.hash(), h )
237 self.assertEqual( m.topologyHash(), t )
238 h = m.hash()
239 t = m.topologyHash()
240
241 m["primVar"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Constant, IECore.IntData( 10 ) )
242 self.assertNotEqual( m.hash(), h )
243 self.assertEqual( m.topologyHash(), t )
244
245 def testBox( self ) :
246

Callers

nothing calls this directly

Calls 8

hashMethod · 0.95
topologyHashMethod · 0.95
setTopologyMethod · 0.95
PrimitiveVariableMethod · 0.80
MeshPrimitiveMethod · 0.45
copyMethod · 0.45
hashMethod · 0.45
topologyHashMethod · 0.45

Tested by

no test coverage detected