Skip to content

Commit 2d86a9a

Browse files
lucienfostierLucien Fostier
authored andcommitted
SceneCacheFileFormat: Add support for collection stored on the internalRoot.
USD doesnt support writing collections on the absolute root prim (`/`) but IECoreScene does. We have some tags we want to be able to write out of Houdini that should be stored on root loacation (`/`), therefore we leverage the internal root to author the collections and map that to IECoreScene root loaction. Note that there is still a limitation for read tags from the root location and converting them to collections stored on the internal root but the current priority is to support writing out.
1 parent 3c4aacc commit 2d86a9a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

contrib/IECoreUSD/src/IECoreUSD/SceneCacheFileFormat.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,18 @@ void UsdSceneCacheFileFormat::writeLocation(
375375
}
376376
}
377377
}
378+
// internal root is mapped to the SceneInterface root '/'
379+
else
380+
{
381+
SceneInterface::NameList tags;
382+
inChild->readTags( tags );
383+
// round trip internal tag name
384+
for ( auto& tag : tags )
385+
{
386+
tag = SceneCacheDataAlgo::fromInternalName( tag );
387+
}
388+
outChild->writeTags( tags );
389+
}
378390

379391
// recursion
380392
SceneInterface::NameList grandChildNames;

0 commit comments

Comments
 (0)