Skip to content

Commit

Permalink
Merge pull request #2408 from marktucker/dev_instance_unloaded_prim_b…
Browse files Browse the repository at this point in the history
…boxes

Allow instancing of bounding boxes drawn on prims with unloaded payloads

(Internal change: 2291910)
  • Loading branch information
pixar-oss committed Aug 22, 2023
2 parents 1c0c4d5 + 7dc3969 commit 1a9f97f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 4 additions & 3 deletions pxr/usdImaging/usdImaging/delegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,11 @@ UsdImagingDelegate::_AdapterLookup(UsdPrim const& prim, bool ignoreInstancing)
// threads.

TfToken adapterKey;
if (_displayUnloadedPrimsWithBounds && !prim.IsLoaded()) {
adapterKey = UsdImagingAdapterKeyTokens->drawModeAdapterKey;
} else if (!ignoreInstancing && prim.IsInstance()) {

if (!ignoreInstancing && prim.IsInstance()) {
adapterKey = UsdImagingAdapterKeyTokens->instanceAdapterKey;
} else if (_displayUnloadedPrimsWithBounds && !prim.IsLoaded()) {
adapterKey = UsdImagingAdapterKeyTokens->drawModeAdapterKey;
} else if (_hasDrawModeAdapter && _enableUsdDrawModes &&
_IsDrawModeApplied(prim)) {
adapterKey = UsdImagingAdapterKeyTokens->drawModeAdapterKey;
Expand Down
6 changes: 1 addition & 5 deletions pxr/usdImaging/usdImaging/drawModeAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1586,11 +1586,7 @@ UsdImagingDrawModeAdapter::GetTransform(UsdPrim const& prim,
// the instance prim, but we want to ignore transforms on that
// prim since the instance adapter will incorporate it into the per-instance
// transform and we don't want to double-transform the prim.
//
// Note: if the prim is unloaded (because unloaded prims are drawing as
// bounds), we skip the normal instancing machinery and need to handle
// the transform ourselves.
if (prim.IsInstance() && prim.IsLoaded()) {
if (prim.IsInstance()) {
return GfMatrix4d(1.0);
} else {
return BaseAdapter::GetTransform(
Expand Down

0 comments on commit 1a9f97f

Please sign in to comment.