-
Notifications
You must be signed in to change notification settings - Fork 208
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
When some instances are hidden there is a difference between the Scene #1186
When some instances are hidden there is a difference between the Scene #1186
Conversation
…e Delegate instance Id and the Maya instance Id. Store a mapping buffter from the Scene Delegate Id to the Maya Id so we can correctly draw selection highlights.
// Assign with the index to the active selection highlight color. | ||
if (const auto state = drawScene.GetActiveSelectionState(id)) { | ||
for (const auto& indexArray : state->instanceIndices) { | ||
for (const auto index : indexArray) { | ||
colorIndices[index] = 1; | ||
if (index < delegateToVp2Map.size()) { | ||
int vp2InstanceIndex = delegateToVp2Map[index]; |
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.
We need to convert the scene delegate instance id into the Maya instance id to know which instance to draw.
} | ||
} else { | ||
instancerWithNoInstances = true; |
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.
This is also necessary to not draw something at the origin when only hidden instances are selected.
I guess we also have to mirror the change to basisCurves? |
// vector. | ||
VtIntArray delegateToVp2Map = static_cast<HdVP2Instancer*>(instancer) | ||
->ComputeInstanceIdToVp2InstanceIdArray(id); | ||
|
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.
It is very similar to the mesh version. The only difference is I don't have to track is any instances are visible here. In the basis curve case I know some instances are visible because of the earlier check, and we re-use a single render item to draw the dormant curves as well as the lead & active items. The only thing we have to get right is which items do we change the color of, and that is what the new changes do.
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.
Following interactive tests are failing with this change
54 - testVP2RenderDelegatePointInstanceSelection (Failed)
55 - testVP2RenderDelegatePointInstancesPickMode (Failed)
Logged PixarAnimationStudios/OpenUSD#1461. Will revisit once we have an answer. |
Delegate instance Id and the Maya instance Id. Store a mapping buffer from the Scene Delegate Id to the Maya Id so we can correctly draw selection highlights.