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

Allow to process USD files to use relative paths when published #70

Merged
merged 5 commits into from
Oct 29, 2024

Conversation

BigRoy
Copy link
Collaborator

@BigRoy BigRoy commented Oct 18, 2024

Changelog Description

This adds a publish plug-in that is able to remap all paths inside the USD layer to a relative path. As such, by doing so - this means that all published USD files will be using solely relative paths to other published paths.

Additional info

This could allow you to 'archive' your project or share the publishes (while maintaining the project's folder structure for the publishes) and share those files with others, allow them to load it - without having to remap anything and without using an asset resolver.

This uses UsdUtils.ModifyAssetPaths which has existed for at least six years in USD, see commit. So should be safe to use nowadays across the board, but for completeness it was added in USD 19.03 so this feature requires USD 19.03+

Example result when loading an asset back in:
image

The top non-relative path is just the 'path' I loaded into Houdini to check the file contents; so that not being relative is entirely correct.

This PR replaces ayon-core PR ynput/ayon-core#957

Testing notes:

  1. Enable the plug-in in settings: ayon+settings://usd/publish/USDOutputProcessorRemapToRelativePaths/enabled. (It is disabled by default.)

image

  1. Publishes from Maya and Houdini (and others that generate USD publishes with asset paths to other files) should now remap all asset paths to relative paths.

Tested:

  • Houdini 20.5.320 on Windows
  • Houdini x.x.x on Linux
  • Maya 2025.2 on Windows

…lug-in `USDOutputProcessorRemapToRelativePaths` you can enable.
@BigRoy BigRoy added the type: enhancement Improvement of existing functionality or minor addition label Oct 18, 2024
@BigRoy BigRoy self-assigned this Oct 18, 2024
@ynbot
Copy link
Contributor

ynbot commented Oct 18, 2024

Copy link
Collaborator

@Lypsolon Lypsolon left a comment

Choose a reason for hiding this comment

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

i did a simple test and it works.
i left a few comments on the implementation.

@BigRoy BigRoy requested a review from Lypsolon October 28, 2024 23:55
Copy link
Collaborator

@Lypsolon Lypsolon left a comment

Choose a reason for hiding this comment

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

works and while i don't like a few of the code quality solutions this works and is good to go.

@BigRoy BigRoy merged commit 7c07423 into develop Oct 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants