@@ -4001,5 +4001,26 @@ def testRoundTripArnoldLight( self ) :
4001
4001
self .assertIn ( "__lights" , root .setNames () )
4002
4002
self .assertEqual ( root .readSet ( "__lights" ), IECore .PathMatcher ( [ "/light" ] ) )
4003
4003
4004
+ def testAlembicIndices ( self ) :
4005
+
4006
+ root = IECoreScene .SceneInterface .create ( os .path .dirname ( __file__ ) + "/data/alembicIndices.usda" , IECore .IndexedIO .OpenMode .Read )
4007
+
4008
+ cube = root .child ( "cube" )
4009
+ self .assertEqual ( cube .attributeNames (), [] )
4010
+ self .assertFalse ( cube .hasAttribute ( "primvars:custom:indices" ) )
4011
+
4012
+ primitive = cube .readObject ( 1.0 )
4013
+ self .assertEqual (
4014
+ set ( primitive .keys () ),
4015
+ { "P" , "N" , "uv" , "custom" }
4016
+ )
4017
+ comparison = IECoreScene .PrimitiveVariable (
4018
+ IECoreScene .PrimitiveVariable .Interpolation .FaceVarying ,
4019
+ IECore .Color3fVectorData ( [ imath .Color3f ( 1 , 0 , 0 ), imath .Color3f ( 0 , 1 , 0 ), imath .Color3f ( 0 , 0 , 1 ),
4020
+ imath .Color3f ( 1 , 1 , 0 ), imath .Color3f ( 0 , 1 , 1 ), imath .Color3f ( 1 , 1 , 1 )] ) [ imath .Color3f ( 1 , 2 , 3 ) ]
4021
+ )
4022
+ self .assertEqual ( primitive ["custom" ], comparison )
4023
+ self .assertEqual ( primitive ["custom" ].indices (), comparison .indices () )
4024
+
4004
4025
if __name__ == "__main__" :
4005
4026
unittest .main ()
0 commit comments