-
Notifications
You must be signed in to change notification settings - Fork 202
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
MAYA-121408 Trigger the populate selection when a new instancer is added #2038
MAYA-121408 Trigger the populate selection when a new instancer is added #2038
Conversation
#ifdef ENABLE_RENDERTAG_VISIBILITY_WORKAROUND | ||
_visibilityVersion = 0; | ||
#endif | ||
_changeVersions.reset(); |
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 refactored how these "versions" of things from USD are tracked into a single struct to keep it simpler.
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.
Much nicer, thx!
{ | ||
_renderTag = tracker.GetRenderTagVersion(); | ||
_visibility = tracker.GetVisibilityChangeCount(); | ||
_instanceIndex = tracker.GetInstancerIndexVersion(); |
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.
GetInstanceIndexVersion doesn't capture all the workflows we care about, but it captures some of them. So at least some things work correctly with this updated version of the code.
#ifdef ENABLE_RENDERTAG_VISIBILITY_WORKAROUND | ||
_visibilityVersion = 0; | ||
#endif | ||
_changeVersions.reset(); |
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.
Much nicer, thx!
The failing test is testVP2RenderDelegatePerInstanceInheritedData in Maya 2022 with USD 20.05. That is a test I would expect to potentially fail with these changes, but the differing image is |
These changes help with the performance issue in #1991. |
@williamkrick, based on the autotest png files, it looks like your PR changes what objects are selected. Why is that? Since your first preflight failed, I just want to make sure we are not introducing here some random behaviour. |
@vlasovi this change is intentionally changing the behavior of this test. What is happening is USD is telling the VP2RenderDelegate which instances of the instancer are selected. When that instancer is modified by adding or removing instances (by hiding them or causing them to not be drawn in some other way) USD doesn't update its internal information about which instances are selected. That causes the selection to "jump" from one instance to another. We work around this issue of drawing the selection incorrectly by calling populateSelection again. Calling populateSelection gets the instance to update its internal state about which instance indices are selected. Calling populateSelection is slow, and we don't have complete dirty information telling us when we need to call it and when we don't need to call it. Originally I had code in place always calling populate selection. Once we discovered it was too slow I created a PR to stop doing the work around (#2034). This change uses the incomplete dirty information to get the selection right some of the time, but not all of the time. We're still fast, and we're more correct than we were before. I also have a PR against USD to provide access to the additional dirty information we need to be correct all the time (PixarAnimationStudios/OpenUSD#1754). |
So probably that means that we may have some random behaviour here. But since we know about that and since we have a plan to fix that later, I think we can move forward with the change. |
…ed. This covers some of the workflows that change the instance indexing, but not all.
bc4df50
to
bf29d65
Compare
or removed. This covers some of the workflows that change the instance indexing, but not all.