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

MAYA-111095 - [GitHub #1340] Mute layer doesn't work when a Layer is … #1423

Merged
merged 3 commits into from
May 25, 2021

Conversation

spinell-adsk
Copy link
Contributor

…loaded through Load Sublayer

-Update layerEditorCommand to use the layer identifier when adding a subLayerPath

…loaded through Load Sublayer

-Update layerEditorCommand to use the layer identifier when adding a subLayerPath
@spinell-adsk
Copy link
Contributor Author

When loading a layer from the layer editor "Load sublayers..." menu, we are using the filesystem path as an argument for
"mayaUsdLayerEditor -edit -insertSubPath" and this command will call Sdf::InsertSubLayerPath() with the filesystem path.
On Windows, if the path is absolute, the driver letter is in uppercase.

When USD need to build the layer stack in (PcpLayerStack::_BuildLayerStack()), it's check inside a cache if a sublayer is muted or not by using the subLayerPath. The cache is filled by function like USDCache::MuteLayer() which take the layer identifier as parameter. So, when USD check inside the cache to know which layer are mutes, it do a string comparation between the sublayerPath and the layer identifier which can be different on Windows. On Windows, If a layer's path is absolute, the layer's identifier will be the path but the driver letter will always be in lower case.

To fix this issue I think there is 2 solutions.
We can force the layer filesytem path to have a lowercase driver letter or we can send the layer identifier Sdf::InsertSubLayerPath().

I checked inside USD codebase (Python/c++ tests) and they are always using identifier with Sdf::InsertSubLayerPath() so I choose this way.

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.

Is there a way to add an automated test for this?

lib/mayaUsd/commands/layerEditorCommand.cpp Outdated Show resolved Hide resolved
lib/mayaUsd/commands/layerEditorCommand.cpp Show resolved Hide resolved
…loaded through Load Sublayer

-Add test and comments.
@spinell-adsk spinell-adsk requested a review from ppt-adsk May 21, 2021 17:55
@spinell-adsk
Copy link
Contributor Author

@ppt-adsk I have added a test for the mute command.

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.

Nice test!

@ppt-adsk ppt-adsk added the ready-for-merge Development process is finished, PR is ready for merge label May 25, 2021
@kxl-adsk kxl-adsk merged commit 91d4a7b into dev May 25, 2021
@kxl-adsk kxl-adsk deleted the spinell/MAYA-111095/load_sub_layer_mute branch May 25, 2021 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants