@@ -71,26 +71,32 @@ def testAccessors( self ) :
7171 )
7272 self .assertFalse ( instancer .getPosition () )
7373
74- def testVaryingPrimitiveVariables ( self ) :
74+ def testVaryingAndFaceVaryingPrimitiveVariables ( self ) :
7575
7676 instancer = IECoreScene .PointInstancer ( 1 )
7777 instancer .setPosition ( IECore .V3fVectorData ( [ imath .V3f ( 0 ) ] ) )
7878 instancer .setScale ( IECore .V3fVectorData ( [ imath .V3f ( 1 ) ] ) )
7979 instancer .setOrientation ( IECore .QuatfVectorData ( [ imath .Quatf () ] ) )
8080 instancer .setPrototypeIndex ( IECore .IntVectorData ( [ 0 ] ) )
8181 instancer .setID ( IECore .Int64VectorData ( [ 10 ] ) )
82+ instancer ["custom" ] = IECoreScene .PrimitiveVariable ( IECoreScene .PrimitiveVariable .Interpolation .Vertex , IECore .IntVectorData ( [ 1 ] ) )
8283
83- instancer2 = instancer .copy ()
84- for key in instancer2 .keys () :
85- p = instancer2 [key ]
86- p .interpolation = IECoreScene .PrimitiveVariable .Interpolation .Varying
87- instancer2 [key ] = p
88-
89- self .assertEqual ( list ( instancer2 .getPosition () ), list ( instancer .getPosition () ) )
90- self .assertEqual ( list ( instancer2 .getScale () ), list ( instancer .getScale () ) )
91- self .assertEqual ( list ( instancer2 .getOrientation () ), list ( instancer .getOrientation () ) )
92- self .assertEqual ( list ( instancer2 .getPrototypeIndex () ), list ( instancer .getPrototypeIndex () ) )
93- self .assertEqual ( list ( instancer2 .getID () ), list ( instancer .getID () ) )
84+ for interpolation in ( IECoreScene .PrimitiveVariable .Interpolation .Varying , IECoreScene .PrimitiveVariable .Interpolation .FaceVarying ) :
85+
86+ with self .subTest ( interpolation = interpolation ) :
87+
88+ instancer2 = instancer .copy ()
89+ for key in instancer2 .keys () :
90+ p = instancer2 [key ]
91+ p .interpolation = interpolation
92+ instancer2 [key ] = p
93+
94+ self .assertEqual ( list ( instancer2 .getPosition () ), list ( instancer .getPosition () ) )
95+ self .assertEqual ( list ( instancer2 .getScale () ), list ( instancer .getScale () ) )
96+ self .assertEqual ( list ( instancer2 .getOrientation () ), list ( instancer .getOrientation () ) )
97+ self .assertEqual ( list ( instancer2 .getPrototypeIndex () ), list ( instancer .getPrototypeIndex () ) )
98+ self .assertEqual ( list ( instancer2 .getID () ), list ( instancer .getID () ) )
99+ self .assertEqual ( instancer2 .instanceAttributes ().keys (), instancer .instanceAttributes ().keys () )
94100
95101 def testVisibilityQuery ( self ) :
96102
0 commit comments