@@ -4001,5 +4001,29 @@ 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 (
4020
+ [ imath .Color3f ( 1 , 0 , 0 ), imath .Color3f ( 0 , 1 , 0 ), imath .Color3f ( 0 , 0 , 1 ),
4021
+ imath .Color3f ( 1 , 1 , 0 ), imath .Color3f ( 0 , 1 , 1 ), imath .Color3f ( 1 , 1 , 1 ) ]
4022
+ ),
4023
+ IECore .IntVectorData ( [ 1 , 1 , 1 , 1 , 4 , 4 , 4 , 4 , 0 , 0 , 0 , 0 , 5 , 5 , 5 , 5 , 2 , 2 , 2 , 2 , 3 , 3 , 3 , 3 ] )
4024
+ )
4025
+ self .assertEqual ( primitive ["custom" ], comparison )
4026
+ self .assertEqual ( primitive ["custom" ].indices (), comparison .indices () )
4027
+
4004
4028
if __name__ == "__main__" :
4005
4029
unittest .main ()
0 commit comments