Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow instancing of bounding boxes drawn on prims with unloaded payloads #2408

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1561,11 +1561,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