From 58dbd47c0bcbe35a754aad9ff908c01c9e026a0a Mon Sep 17 00:00:00 2001 From: Mark Tucker Date: Sun, 19 Sep 2021 19:36:54 -0400 Subject: [PATCH] Fix display of materials on instanceable prototype on point instancers. The fix for #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 #1449 is only applied to the instanceable prim, not the contained instance proxy prims. Fixes #1626 --- pxr/usdImaging/usdImaging/pointInstancerAdapter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pxr/usdImaging/usdImaging/pointInstancerAdapter.cpp b/pxr/usdImaging/usdImaging/pointInstancerAdapter.cpp index 94e25747be..7e24f8012d 100644 --- a/pxr/usdImaging/usdImaging/pointInstancerAdapter.cpp +++ b/pxr/usdImaging/usdImaging/pointInstancerAdapter.cpp @@ -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);