-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/pinning file support #22
Conversation
okay. We could implement a function that gets all the data from the stage ourselves and not rely on the UsdUtils functions. @dee-ynput @antirotor, do you have any opinions about this? https://forum.aousd.org/t/usdutils-extractexternalreferences-converts-udim-to-1001-in-23-11/1669 |
…tils functions we used before
Co-authored-by: Roy Nieterau <[email protected]>
Co-authored-by: Roy Nieterau <[email protected]>
Co-authored-by: Roy Nieterau <[email protected]>
Co-authored-by: Roy Nieterau <[email protected]>
Co-authored-by: Roy Nieterau <[email protected]>
Co-authored-by: Roy Nieterau <[email protected]>
Co-authored-by: Roy Nieterau <[email protected]>
…gle function call
…is Experimental to use it
… via rootles paths
Pinning File creation now allows to create a pinning file with relative paths and rootless paths for both key and value. PS: resolve also has the update but i did not recompile it yet. |
New Resolver's Are uploaded to LakeFs Pinning File Branch for testing. |
Overall this looks good - However, I'm getting this when running inside e.g. Maya: # Error: module 'pxr.UsdShade' has no attribute 'UdimUtils'
# # Traceback (most recent call last):
# # File "<maya console>", line 15, in <module>
# # File "E:\dev\ayon-usd\client\ayon_usd\standalone\usd\pinning\__pinning_file_generation_funcs.py", line 334, in generate_pinning_file
# # pinning_data = get_asset_dependencies(entry_usd, resolver)
# # File "E:\dev\ayon-usd\client\ayon_usd\standalone\usd\pinning\__pinning_file_generation_funcs.py", line 207, in get_asset_dependencies
# # recursive_result = get_asset_dependencies(
# # File "E:\dev\ayon-usd\client\ayon_usd\standalone\usd\pinning\__pinning_file_generation_funcs.py", line 207, in get_asset_dependencies
# # recursive_result = get_asset_dependencies(
# # File "E:\dev\ayon-usd\client\ayon_usd\standalone\usd\pinning\__pinning_file_generation_funcs.py", line 207, in get_asset_dependencies
# # recursive_result = get_asset_dependencies(
# # [Previous line repeated 3 more times]
# # File "E:\dev\ayon-usd\client\ayon_usd\standalone\usd\pinning\__pinning_file_generation_funcs.py", line 191, in get_asset_dependencies
# # udim_data = _resolve_udim(identifier, layer)
# # File "E:\dev\ayon-usd\client\ayon_usd\standalone\usd\pinning\__pinning_file_generation_funcs.py", line 123, in _resolve_udim
# # resolved_udims = UsdShade.UdimUtils.ResolveUdimTilePaths(
# # AttributeError: module 'pxr.UsdShade' has no attribute 'UdimUtils' This may be due to USD version that is old in Maya 2024.2 with MayaUSD 0.27? It works in Houdini 20.0.273 however. I used something like: from ayon_usd.standalone.usd import pinning
import ayon_api
import os
def get_root_info(project_name=None) -> "dict[str, str]":
project_name = project_name or os.environ.get("AYON_PROJECT_NAME")
return ayon_api.get(f"projects/{project_name}/siteRoots").data
usd_path = r"/path/to/entry.usd"
pinning_file_path = "E:/asset_pin.json"
root_info = get_root_info()
pinning.generate_pinning_file(usd_path, root_info, pinning_file_path) Also, I'm getting lots of prints of the AYON-USD downloads folder in the launcher console logs. You seem to have an extraneous print statement somewhere? :) |
@BigRoy i fixed the udim issue if you can give it a quick test that be great. also i just saw that the tray publisher would allow for texture publish (not really Udim ready) but we would need a product that has in the name and the > is not allowed. not important just wanted to mention (other than that texture resolve via uri works) |
@BigRoy i tested the pinning file creation on Maya 2025_5(just installed) it works there gonna install 2024_2 and then test there tested with 2024_2(new_install) and yes UdimUtils is not there love it. |
…sure that win drive letters are lower case
@BigRoy i just added a function to make the Win Drive letters lower case. if you could give it a short spin that be great. also the print Downloads dir should be fixed |
i believe this is done ?
|
client/ayon_usd/standalone/usd/pinning/__pinning_file_generation_funcs.py
Outdated
Show resolved
Hide resolved
client/ayon_usd/standalone/usd/pinning/__pinning_file_generation_funcs.py
Outdated
Show resolved
Hide resolved
client/ayon_usd/standalone/usd/pinning/__pinning_file_generation_funcs.py
Outdated
Show resolved
Hide resolved
client/ayon_usd/standalone/usd/pinning/__pinning_file_generation_funcs.py
Outdated
Show resolved
Hide resolved
client/ayon_usd/standalone/usd/pinning/__pinning_file_generation_funcs.py
Outdated
Show resolved
Hide resolved
client/ayon_usd/standalone/usd/pinning/_pinning_file_generation_funcs.py
Outdated
Show resolved
Hide resolved
client/ayon_usd/standalone/usd/pinning/_pinning_file_generation_funcs.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had the open comment on code style for _normalize_path
. Other than that this looks nice! I haven't been able yet to confirm the actual usage of the file pinning itself - since I was way too busy. But since this is about to get merged anyway with continuous work still by @antirotor in the follow up PR this is about as good a time as any to get the bulk of this in.... and then do a full test run again since we're still in alpha.
…n_funcs.py Co-authored-by: Roy Nieterau <[email protected]>
TODO
ADDON_SETTINGS_USD_RESOLVER_LOG_LVL
This Pr tracks a pinning file creation via the Usd API.
Here are some related chats on the AOUSD forums.
https://forum.aousd.org/t/get-all-references-sublayers-recursively-of-stage/1322/2?u=bigroynl
https://forum.aousd.org/t/sdf-format-args-and-custom-ar-resolvers/1660/6
function to get info about the USD version
Usd.GetVersion()