Skip to content

Commit

Permalink
HYDRA-764 : Rename root prim
Browse files Browse the repository at this point in the history
  • Loading branch information
debloip-adsk committed Dec 21, 2023
1 parent 4b2d0f7 commit 97e18a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions test/lib/mayaUsd/render/mayaToHydra/cpp/testPrimInstancing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
PXR_NAMESPACE_USING_DIRECTIVE

namespace {
FindPrimPredicate findRootPredicate = PrimNamePredicate("root");
FindPrimPredicate findInstanceableCubePredicate = PrimNamePredicate("instanceableCube");
HdDataSourceLocator instancerLocator = HdDataSourceLocator(TfToken("instance"), TfToken("instancer"));
} // namespace

Expand All @@ -33,14 +33,14 @@ TEST(PrimInstancing, testUsdPrimInstancing)
ASSERT_GT(sceneIndices.size(), 0u);
SceneIndexInspector inspector(sceneIndices.front());

// Find the root prim
PrimEntriesVector rootPrims = inspector.FindPrims(findRootPredicate);
ASSERT_EQ(rootPrims.size(), 1u);
HdSceneIndexPrim rootPrim = rootPrims.front().prim;
// Find the instanceable cube prim
PrimEntriesVector instanceableCubePrims = inspector.FindPrims(findInstanceableCubePredicate);
ASSERT_EQ(instanceableCubePrims.size(), 1u);
HdSceneIndexPrim instanceableCubePrim = instanceableCubePrims.front().prim;

// Retrieve the instancer data source
auto instancerDataSource = HdTypedSampledDataSource<SdfPath>::Cast(
HdContainerDataSource::Get(rootPrim.dataSource, instancerLocator));
HdContainerDataSource::Get(instanceableCubePrim.dataSource, instancerLocator));
ASSERT_TRUE(instancerDataSource);

// Ensure the instancer prim exists and is populated
Expand All @@ -55,7 +55,7 @@ TEST(PrimInstancing, testUsdPrimInstancing)
ASSERT_EQ(instancerPrim.primType, HdPrimTypeTokens->instancer);
ASSERT_NE(instancerPrim.dataSource, nullptr);

// Ensure the cube prim exists and is populated
// Ensure the reference cube prim exists and is populated
auto findCubePredicate
= [instancerPath](const HdSceneIndexBasePtr& sceneIndex, const SdfPath& primPath) -> bool {
return primPath.HasPrefix(instancerPath) && primPath.GetName() == "cubeMesh";
Expand Down
4 changes: 2 additions & 2 deletions test/testSamples/testPrimInstancing/scene.usda
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#usda 1.0
(
defaultPrim = "root"
defaultPrim = "instanceableCube"
)

# We need to have an instanceable prim reference a separate USD file
# to confirm the fix for HYDRA-764, as referencing a prim in the same
# file did not cause issues.
def Xform "root" (
def Xform "instanceableCube" (
instanceable = true
prepend references = @cube.usda@
)
Expand Down

0 comments on commit 97e18a9

Please sign in to comment.