@@ -320,6 +320,7 @@ def testTagsLoadedAsCollections( self ):
320
320
# includes
321
321
fileName = os .path .join ( self .temporaryDirectory (), "testUSDTags.scc" )
322
322
m = IECoreScene .SceneCache ( fileName , IECore .IndexedIO .OpenMode .Write )
323
+ m .writeTags ( ["geoId:chessy" ] )
323
324
t = m .createChild ( "t" )
324
325
s = t .createChild ( "s" )
325
326
t .writeTags ( ["t1" , "all" , "asset-(12)" ] )
@@ -330,6 +331,16 @@ def testTagsLoadedAsCollections( self ):
330
331
stage = pxr .Usd .Stage .Open ( fileName )
331
332
root = stage .GetPseudoRoot ()
332
333
334
+ tagInternalRootPrim = root .GetPrimAtPath ( f"/{ IECoreUSD .SceneCacheDataAlgo .internalRootName ()} " )
335
+ self .assertEqual (
336
+ tagInternalRootPrim .GetRelationship (
337
+ "collection:{}:includes" .format (
338
+ IECoreUSD .SceneCacheDataAlgo .toInternalName ( "geoId:chessy" )
339
+ )
340
+ ).GetTargets (),
341
+ [ pxr .Sdf .Path ( f"/{ IECoreUSD .SceneCacheDataAlgo .internalRootName ()} " ) ]
342
+ )
343
+
333
344
tagPrim = root .GetPrimAtPath ( "/{}/t" .format ( IECoreUSD .SceneCacheDataAlgo .internalRootName () ) )
334
345
self .assertTrue ( tagPrim )
335
346
@@ -346,6 +357,10 @@ def testTagsLoadedAsCollections( self ):
346
357
stage .Export ( exportPath )
347
358
348
359
scene = IECoreScene .SharedSceneInterfaces .get ( exportPath )
360
+ # check root tags
361
+ self .assertTrue ( "geoId:chessy" in scene .readTags () )
362
+
363
+ # check children tags
349
364
for tag , paths in tags .items ():
350
365
for path in paths :
351
366
child = scene .scene ( IECoreScene .SceneInterface .stringToPath ( path ) )
0 commit comments