Skip to content

Commit

Permalink
Fix display of materials on instanceable prototype on point instancers.
Browse files Browse the repository at this point in the history
The fix for PixarAnimationStudios#1449 looks like it broke material bindings in the case where
a point instancer prototype was marked as instanceable, but the material
was bound inside the prototype (on an instance proxy). The bound material
was being expressed with the instance proxy path instead of the prototype
path, which is how the material is actually identified in hydra. So now
the fix for PixarAnimationStudios#1449 is only applied to the instanceable prim, not the
contained instance proxy prims.

Fixes PixarAnimationStudios#1626
  • Loading branch information
marktucker committed Sep 19, 2021
1 parent 562750f commit 58dbd47
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pxr/usdImaging/usdImaging/pointInstancerAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,10 @@ UsdImagingPointInstancerAdapter::_PopulatePrototype(
populatePrim = _GetPrim(instancerChain.at(1));
}

SdfPath const& materialId = GetMaterialUsdPath(instanceProxyPrim);
SdfPath const& materialId =
populatePrim.IsInstance()
? GetMaterialUsdPath(instanceProxyPrim)
: GetMaterialUsdPath(populatePrim);
TfToken const& drawMode = GetModelDrawMode(instanceProxyPrim);
TfToken const& inheritablePurpose =
GetInheritablePurpose(instanceProxyPrim);
Expand Down

0 comments on commit 58dbd47

Please sign in to comment.