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-127404 sub-layers relative to their parent #2885

Merged
merged 5 commits into from
Mar 9, 2023

Conversation

pierrebai-adsk
Copy link
Collaborator

  • Handle making the root layer relative to the scene when converting anonymous layers.
  • Added a helper class to change the current directory temporarily.
  • Added getLayerFileDir helper to get the directory containing a given layer.
  • Added getPathRelativeToLayerFile helper to make a path relative to a layer.
  • Added prepareLayerSaveUILayer helper to prepare the UI to save layers in case the paths need to be relative.
  • AddedrequireUsdPathsRelativeToParentLayer helper to verify if paths should be relative to a parent layer.
  • Updated saveAnonymousLayer helper function to handle saving sub-layers relative to their parent.
  • Added a parentLayer function to the LayerTreeItem to retrieve the parent layer, if any.
  • Added support to save layer relative to their parent in the LayerTreeItem::saveAnonymousLayer function.
  • Changed the saveLayerUI interface function to take the parent layer, so that sub-layer can be made relative to their parent if needed.
  • Changed SaveLayersDialog::saveLayerFilePathUI to accept the parent layer and passing it to the UI.
  • Updated SaveLayerPathRow::onOpenBrowser to handle saving sub-layers relative to the parent.
  • Added MEL script code for the UI to support saving sub-layer relative to their parent layer.
  • Added Python usdSubLayerFileRelative class to implement the save layer UI for saving sub-layers relative to their parent.
  • Updated context menu to use the new functions.
  • Replace the sub-layer in its parent using multiple possible identifiers.
  • Make sure to use the desired file path form (absolute or relative) when replacing the sub-layer in its parent.
  • Temporarily modify the current directory when initially loading the sub-layer.

- Handle making the root layer relative to the scene when converting anonymous layers.
- Added a helper class to change the current directory temporarily.
- Added getLayerFileDir helper to get the directory containing a given layer.
- Added getPathRelativeToLayerFile helper to make a path relative to a layer.
- Added prepareLayerSaveUILayer helper to prepare the UI to save layers in case the paths need to be relative.
- AddedrequireUsdPathsRelativeToParentLayer helper to verify if paths should be relative to a parent layer.
- Updated saveAnonymousLayer helper function to handle saving sub-layers relative to their parent.
- Added a parentLayer function to the LayerTreeItem to retrieve the parent layer, if any.
- Added support to save layer relative to their parent in the LayerTreeItem::saveAnonymousLayer function.
- Changed the saveLayerUI interface function to take the parent layer, so that sub-layer can be made relative to their parent if needed.
- Changed SaveLayersDialog::saveLayerFilePathUI to accept the parent layer and passing it to the UI.
- Updated SaveLayerPathRow::onOpenBrowser to handle saving sub-layers relative to the parent.
- Added MEL script code for the UI to support saving sub-layer relative to their parent layer.
- Added Python usdSubLayerFileRelative class to implement the save layer UI for saving sub-layers relative to their parent.
- Updated context menu to use the new functions.
- Replace the sub-layer in its parent using multiple possible identifiers.
- Make sure to use the desired file path form (absolute or relative) when replacing the sub-layer in its parent.
- Temporarily modify the current directory when initially loading the sub-layer.
vlasovi
vlasovi previously approved these changes Feb 24, 2023
Copy link
Collaborator

@vlasovi vlasovi left a comment

Choose a reason for hiding this comment

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

Looks good

@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Feb 24, 2023
seando-adsk
seando-adsk previously approved these changes Feb 28, 2023
Copy link
Collaborator

@seando-adsk seando-adsk left a comment

Choose a reason for hiding this comment

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

Sorry it took me so long to review this. You'll need some changes since I've merged in my relative preview fields.

lib/mayaUsd/utils/utilSerialization.h Outdated Show resolved Hide resolved
plugin/adsk/scripts/mayaUsd_USDRootFileRelative.py Outdated Show resolved Hide resolved
plugin/adsk/scripts/mayaUsd_USDRootFileRelative.py Outdated Show resolved Hide resolved
plugin/adsk/scripts/mayaUsd_USDRootFileRelative.py Outdated Show resolved Hide resolved
plugin/adsk/scripts/mayaUsd_layerEditorFileDialogs.mel Outdated Show resolved Hide resolved
@pierrebai-adsk pierrebai-adsk dismissed stale reviews from seando-adsk and vlasovi via b971627 March 1, 2023 15:14
vlasovi
vlasovi previously approved these changes Mar 1, 2023
@pierrebai-adsk
Copy link
Collaborator Author

@seando-adsk I believe I made all requested changes.

@seando-adsk seando-adsk merged commit 31c401b into dev Mar 9, 2023
@seando-adsk seando-adsk deleted the bailp/MAYA-127404/save-relative-sub-layers branch March 9, 2023 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adsk Related to Autodesk plugin 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.

4 participants