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

Load USD loaders with filepath from entity URI #26

Merged
merged 17 commits into from
Aug 30, 2024

Conversation

BigRoy
Copy link
Contributor

@BigRoy BigRoy commented Jul 5, 2024

Changes the load behavior for the loaders that load to LOPs (e.g. /stage) to use AYON Entity URIs that can be resolved with the AYON USD Resolver.

TODO

  • Use ayon api endpoint to resolve to the entity URI
  • Allow toggle in project settings between loading to AYON entity URI or regular filepath.
  • The Load Asset LOP may need custom work because it manages the filepath using HDA utils maybe? This may need a dedicated "use entity URI" toggle on the HDA itself, could be a follow up issue/PR to this one.
    • Find a way to set the "default" using studio choice from settings when creating new nodes. This may need to be a "on created" callback using some sort of cached settings.

Additional context

Example URI after load is:

ayon+entity://ayontest/asset/char_roy&product=usdAsset&version=v004&representation=usd

On the Load Asset LOP and Load Shot LOP there's now a toggle that defines whether it resolves as entity URI or not:

image

Testing notes

Build package and upload new addon.
Test with settings enabled/disabled:
image

ayon+settings://houdini/load/LOPLoadAssetLoader/use_ayon_entity_uri
ayon+settings://houdini/load/LOPLoadShotLoader/use_ayon_entity_uri
ayon+settings://houdini/load/USDSublayerLoader/use_ayon_entity_uri
ayon+settings://houdini/load/USDReferenceLoader/use_ayon_entity_uri
ayon+settings://houdini/load/SopUsdImportLoader/use_ayon_entity_uri
  1. All loaders should still work.
  2. The entity URIs should be correct and work with AYON USD Resolver
  3. Updating/managing of versions should still work.

@BigRoy BigRoy requested a review from antirotor July 5, 2024 10:10
@BigRoy BigRoy force-pushed the enhancement/usd_load_ayon_uri branch from 2a1e32e to e584296 Compare July 5, 2024 13:58
@MustafaJafar MustafaJafar added USD and removed USD labels Jul 11, 2024
@BigRoy BigRoy assigned BigRoy and unassigned antirotor Aug 27, 2024
@BigRoy BigRoy marked this pull request as ready for review August 27, 2024 14:09
@BigRoy BigRoy added the type: enhancement Improvement of existing functionality or minor addition label Aug 27, 2024
@BigRoy BigRoy requested a review from Lypsolon August 27, 2024 14:11
@BigRoy BigRoy requested a review from MustafaJafar August 27, 2024 18:13
Copy link

@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.

in not sure if we should ask the user to use uri at every step of the way tbh.
there are multiple Prs now where you have to enable Uri usage.

i dont say we should not allow for fine grain control if needed but i believe we should have one big button that says Use uri. and then the option to disable that for individual Systems.

@BigRoy
Copy link
Contributor Author

BigRoy commented Aug 29, 2024

in not sure if we should ask the user to use uri at every step of the way tbh. there are multiple Prs now where you have to enable Uri usage.

i dont say we should not allow for fine grain control if needed but i believe we should have one big button that says Use uri. and then the option to disable that for individual Systems.

It's not the user by the way, it's the studio "admin" defining that once in settings. So yes, it now provides granularity. We could do it differently by making all these enums that are three options:

  • Use default
  • Enabled
  • Disabled

And when "Use Default" is set it uses the big button.
Happy to hear of better ideas, but I definitely wanted to offer some granularity but wasn't sure what the best approach would be to maintain but also making it easy to manage the setting.

@iLLiCiTiT @Innders ideas?

Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

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

There is a slight glitch in URIs:

This URI works for me:

ayon+entity://USD_DEMO/assets/box?product=usdAsset&version=v002&representation=usd

and this is filled by this PR:

ayon+entity://USD_DEMO/assets/box&product=usdAsset&version=v002&representation=usd

The issue is here: ...box&product... - it should use question mark.

This is handled by server call if I am not mistaken, so please disregard this if this is the case and we need to fix it there.

@BigRoy
Copy link
Contributor Author

BigRoy commented Aug 30, 2024

There is a slight glitch in URIs:

This URI works for me:

ayon+entity://USD_DEMO/assets/box?product=usdAsset&version=v002&representation=usd

and this is filled by this PR:

ayon+entity://USD_DEMO/assets/box&product=usdAsset&version=v002&representation=usd

The issue is here: ...box&product... - it should use question mark.

This is handled by server call if I am not mistaken, so please disregard this if this is the case and we need to fix it there.

Correct - I fixed it this morning: ynput/ayon-backend#329
You'll need latest dev tag of the ayon-docker to get the fix.

@antirotor can you test and approve if it works?

Do note that there was also an issue with using os.path.normpath on these paths because it'd strip the double forward slash - so please check each loader individually to see if they are not lacking those slashes (and even better if you can test whether the resolver resolves it correctly!)

@BigRoy BigRoy requested a review from antirotor August 30, 2024 12:52
Remove `os.path.normpath` completely. This should be completely fine, we were already _not_ doing that anyway on `update()` logic. So now `load()` actually matches the `update()` logic.
Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

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

So it works now, resolves correctly too. One exception is Load USD to SOPs - not sure if this is actually resolvable by the resolver?

image

Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

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

works now as expected

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.

4 participants