-
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
HYDRA-1457 : Fix UsdStageMap::allStages to not rely on the internal cache when it can be outdated #4128
base: dev
Are you sure you want to change the base?
Conversation
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.
IDK if there can be perf implication of calling getAllNames(), but we'll see.
I think there is which is one of the reasons we are using the stage cache here. @debloip-adsk It seems to me like the "real" problem could be a missing call to |
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.
Are there any performance implications for this change? How often is this run?
That is kind of hard to say. Its available from a python function called |
The core problem I'm seeing here is : when/from where would we set the cache dirty? Once the node rename happens, there is a UFE notification and a Maya notification sent, but Maya UFE camera code receives the UFE notification first, and then immediately queries MayaUsd's UsdStageMap through Ufe::SceneSegmentHandler::findGatewayItems before it has received the Maya node rename notification. So MayaUsd has no idea any change has happened before it is queried for updated info. Even if we added support in MayaUsd's UsdStageMap for handling UFE notifications, we'd still depend on the notification order, which doesn't seem super robust either. Is there a way to set the cache dirty through Maya/UFE? |
Relying on notification order is very, very bad.
Ran out of ideas at this point :) If there is any way we can convert the reliance on callbacks in this code to a fixed call order, we should explore that. If changes to Maya are acceptable, maybe there is a way to insert some kind of pre-callback callback :( to "solve" the problem (really push the problem back a little bit and hope that's sufficient). |
Are the UFE camera problems inside MayaUSD itself? Can that code detect the failure mode and manually call UsdStageMap::setDirty and try again? Or are the failures indistinguishable from normal operations? |
I think there is, but it would fix the problem only for this specific case, with further changes or new code we might run into the same issue again.
This doesn't seem super easy, as from the looks of it we'd likely need to make changes to the core Maya system, which seems pretty risky
The problem is a result of the interaction between both the Maya UFE camera system and MayaUsd's UFE implementation, where Maya queries MayaUsd but MayaUsd returns incorrect data due to relying on a notification order that is not the one happening.
The MayaUsd code can't really detect the failure mode without first querying for the update state of things, which is what the current change is already doing, so there wouldn't be much benefit. I ran some rough performance measurements of the That being said, the practical/observable impact of this is perf difference is hard to tell, so I started two preflights with and without the change so this can be manually tested. I will post the links once they're ready so QA (likely @santosd) can take a look. My outlook on this right now is the following : if the perf impact of the current change is acceptable, then we go with that, otherwise we would try doing something like Pierre's first suggestion ( |
Pixar (issue #4125) has reported a performance issue with camera finding which uses |
We have an alternative fix that we can do in Maya itself and that can be included in the PR that implements the changes to UFE cameras, see this commit : https://git.autodesk.com/maya3d/maya/pull/30320/commits/e4f7eaa8ceb095e4b443cbe35ef58c6ea0be630d. It does not fix the root issue with notification order and the |
This fix is notably required in order to get some UFE camera changes working in Maya.