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-106310 - Crash when querying target layer and nothing is assigne… #1015

Merged
merged 3 commits into from
Dec 23, 2020

Conversation

spinell-adsk
Copy link
Contributor

…d the target

  • Update the mayaUsdLayerEditor cmd to set the root layer as the edit target when the command is used the remove a layer and this layer is the edit target

…d the target

- Update the mayaUsdLayerEditor cmd to set the root layer as the edit target when the command is used the remove a layer and this layer is the edit target
@spinell-adsk
Copy link
Contributor Author

Removed a layer that's the current edit target with the command mayaUsdLayerEditor will cause a crash when querying the current edit target. UsdStage will return a dangling pointer when the edit layer is removed.

To fix this issue, I updated the command mayaUsdLayerEditor to set the root layer as the edit layer when removing a layer and this layer is the edit target.

To be able to access to the UsdStage inside the command, I updated the signature for removing a layer.

  • Before: mayaUsdLayerEditor -e removeSubPath $index $layer
  • Now: mayaUsdLayerEditor -e removeSubPath $index $shape $layer

@kxl-adsk kxl-adsk added the workflows Related to in-context workflows label Dec 17, 2020
if (currentTarget
&& currentTarget->GetIdentifier() == subLayerHandle->GetIdentifier()) {
_isEditTarget = true;
stage->SetEditTarget(stage->GetRootLayer());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be worth considering matching the logic with base proxy shape, ie fallback to session layer of root layer can’t be edited or we forced session layer with option var.

@kxl-adsk kxl-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Dec 22, 2020
@kxl-adsk kxl-adsk merged commit e6aed68 into dev Dec 23, 2020
@kxl-adsk kxl-adsk deleted the spinell/MAYA-106310/crash_query_deleted_edit_target branch December 23, 2020 18:36
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 workflows Related to in-context workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants