-
Notifications
You must be signed in to change notification settings - Fork 203
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
Fix the regression for selecting single instance objects. #620
Fix the regression for selecting single instance objects. #620
Conversation
|
||
const Ufe::PathSegment pathSegment(usdPath.GetText(), USD_UFE_RUNTIME_ID, USD_UFE_SEPARATOR); | ||
const Ufe::SceneItem::Ptr& si = handler->createItem(_proxyShapeData->ProxyShape()->ufePath() + pathSegment); | ||
if (!si) { | ||
TF_WARN("UFE runtime is not updated for the USD stage. Please save scene and reopen."); | ||
TF_WARN("Failed to create UFE scene item for Rprim '%s'", rprimId.GetText()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous warning message is no longer valid.
|
||
const SdfPath usdPath(_sceneDelegate->ConvertIndexPathToCachePath(rprimId)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConvertIndexPathToCachePath() is only required when calling with GetPathForInstanceIndex().
const int drawInstID = intersection.instanceID(); | ||
const int usdInstID = drawInstID - 1; | ||
|
||
#if defined(USD_IMAGING_API_VERSION) && USD_IMAGING_API_VERSION >= 13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the single instance selection issue for both conditional compilation branches.
#if defined(USD_IMAGING_API_VERSION) && USD_IMAGING_API_VERSION >= 13 | ||
rprimId = _sceneDelegate->GetScenePrimPath(rprimId, usdInstID); | ||
const int usdInstID = drawInstID > 0 ? drawInstID - 1 : 0; | ||
SdfPath usdPath = _sceneDelegate->GetScenePrimPath(rprimId, usdInstID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattyjams I think this new API also handles nested instancing, selection for nested instancing case can work as expected (before this API we could only select the highest instancing group but not an exact instance from the viewport). Very nice!
The regression #153 was caused by not using instanced draw for single-instance objects and reproducible on Maya 2020 and before.
Recent Maya preview releases already support consolidation for instanced render items so the performance workaround has been removed, therefore the regression won't be reproduced for those preview releases.