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

Method testSamePrimVars

test/IECoreScene/TransformOpTest.py:100–110  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

98 self.assertEqual( ms["notVel"].data, m["notVel"].data )
99
100 def testSamePrimVars( self ) :
101
102 m = IECoreScene.MeshPrimitive.createBox( imath.Box3f( imath.V3f( -1 ), imath.V3f( 1 ) ) )
103 IECoreScene.MeshNormalsOp()( input = m, copyInput = False )
104 m["vel"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Vertex, IECore.V3fVectorData( [ imath.V3f( 0.5 ) ] * 8, IECore.GeometricData.Interpretation.Vector ) )
105 m["sameVel"] = m["vel"]
106
107 ms = IECoreScene.TransformOp()( input=m, primVarsToModify = IECore.StringVectorData( [ "vel", "sameVel" ] ), matrix = IECore.M44fData( imath.M44f().scale( imath.V3f( 1, 2, 3 ) ) ) )
108
109 self.assertEqual( ms["vel"].data, IECore.V3fVectorData( [ x * imath.V3f( 1, 2, 3 ) for x in m["vel"].data ], IECore.GeometricData.Interpretation.Vector ) )
110 self.assertEqual( ms["vel"].data, ms["sameVel"].data )
111
112 def testIdenticalPrimVarsCanBeExcluded( self ) :
113

Callers

nothing calls this directly

Calls 4

MeshNormalsOpMethod · 0.80
PrimitiveVariableMethod · 0.80
TransformOpMethod · 0.80
createBoxMethod · 0.45

Tested by

no test coverage detected