Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions contrib/IECoreUSD/test/IECoreUSD/USDSceneTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4001,5 +4001,29 @@ def testRoundTripArnoldLight( self ) :
self.assertIn( "__lights", root.setNames() )
self.assertEqual( root.readSet( "__lights" ), IECore.PathMatcher( [ "/light" ] ) )

def testAlembicIndices( self ) :

root = IECoreScene.SceneInterface.create( os.path.dirname( __file__ ) + "/data/alembicIndices.usda", IECore.IndexedIO.OpenMode.Read )

cube = root.child( "cube" )
self.assertEqual( cube.attributeNames(), [] )
self.assertFalse( cube.hasAttribute( "primvars:custom:indices" ) )

primitive = cube.readObject( 1.0 )
self.assertEqual(
set( primitive.keys() ),
{ "P", "N", "uv", "custom" }
)
comparison = IECoreScene.PrimitiveVariable(
IECoreScene.PrimitiveVariable.Interpolation.FaceVarying,
IECore.Color3fVectorData(
[ imath.Color3f( 1, 0, 0 ), imath.Color3f( 0, 1, 0 ), imath.Color3f( 0, 0, 1 ),
imath.Color3f( 1, 1, 0 ), imath.Color3f( 0, 1, 1 ), imath.Color3f( 1, 1, 1 ) ]
),
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 ] )
)
self.assertEqual( primitive["custom"], comparison )
self.assertEqual( primitive["custom"].indices(), comparison.indices() )

if __name__ == "__main__":
unittest.main()
Binary file not shown.
8 changes: 8 additions & 0 deletions contrib/IECoreUSD/test/IECoreUSD/data/alembicIndices.usda
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#usda 1.0

def Mesh "cube" (
references = @./alembicIndices.abc@
)
{
}