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

HYDRA-1457 : Fix UsdStageMap::allStages to not rely on the internal cache when it can be outdated #4128

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

debloip-adsk
Copy link
Collaborator

This fix is notably required in order to get some UFE camera changes working in Maya.

@debloip-adsk debloip-adsk self-assigned this Feb 20, 2025
Copy link
Collaborator

@pierrebai-adsk pierrebai-adsk left a 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.

@seando-adsk
Copy link
Collaborator

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 setDirty() to make sure that when allStages() is called it will rebuild the cache first.

Copy link
Collaborator

@ppt-adsk ppt-adsk left a 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?

@seando-adsk
Copy link
Collaborator

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 getAllStages() and I've seen it being called in a few code places, such as from SceneSegmentHandler::findUsdGatewayItems() and the proxyRenderDelegate.

@debloip-adsk
Copy link
Collaborator Author

debloip-adsk commented Feb 21, 2025

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants