-
Notifications
You must be signed in to change notification settings - Fork 1
runtime asset Redirection with Layered Loading System #42
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
base: develop
Are you sure you want to change the base?
runtime asset Redirection with Layered Loading System #42
Conversation
|
after a talk with @BigRoy we came to the idea that every time the resolver context is create and dose not have an RDF connected we will create an RDF instance based on an uuid and then when we get hold of a class copy of the resolver conext we can get acess to set RDF via the uuid |
|
I'm looking to test this PR and have the resolver inside Houdini now. I'm just not sure which of the example test codes to use and how they apply to a workflow in Houdini. Do note that with default settings on creating a single Load Asset LOP I get this Houdini console output: Seems there's some default debug logging enabled? Also, I'm somewhat confused by those JSONs having the content: {
"data": null,
"subLayers": []
}Any examples on what to do with those files? What do the |
from usdAssetResolver import AyonUsdResolver
node = hou.pwd()
stage = node.editableStage()
ctx = stage.GetPathResolverContext().Get()[0]
rd = ctx.getRedirectionFile()
rd.reload() # <- crashesAll those cases should not crash Houdini.
from usdAssetResolver import AyonUsdResolver
node = hou.pwd()
stage = node.editableStage()
ctx = stage.GetPathResolverContext().Get()[0]
rdf_file = ctx.getRedirectionFile()
rdf_file.addRedirection("missingRef.usda", "./sphere3.usda")
rdf_file.save()
|
|
Some context for this PR. this pr implements a redirection system to allow informing an usd asset resolver about paths that should be at a different place at runtime. its not the same as the pinning suport because pinning is suposed to be static by desing. currently the system dose create files on disk as every rdf expects that it will be on disk. the lakeFs branch for updates is here: |
|
The latest version fixes the saving and reloading of the RDF file - so that does not crash anymore. However, it still crashes if the configured asset file is invalid or does not exist. We should instead capture that with a warning and instead just continue as if there were no redirection file path set? We should at least just warn on invalid layers or files instead of crashing. The same goes for subLayers in the json. We should at the very least avoid the resolver taking down e.g. Houdini with a hard crash. Also, it seems if you query |

this pr provides runtime and load time redirectoin for assets consumed via the usd resoler.
the idea is as follows.
Implementation
the rdfs are implemented as thread save classes using shared mutex for parallel read and single write.
they are stored in an defined format as a json file
they allow layering and the first file loaded will be the strongest allowing for composition.
there is a function
getRdFilethat allows you to get an RDF instance via an abs file path (the file path dose not need to be abselute but all internal systems use an abs file path and you need to fully match the file path to get the right instance)using the system
Option A
the most straight forward option is to have a stage that has an rdf configured in its custom layer metada
it is important that we use an TF token becuase other values do not allow for
.in the path.also internally we need to cast the value at the token so if its not an tftoken its gonna end up with UB.
the root usd will be loaded via _CreateDefaultContextForAsset and we will extract the rdf file via searching for the key
AyonUsdResolverRedirectionFile.Option B (not working)
it is wanted that we can just create a stage and then add an redirdctoin file to the resolver context to allow for redirection. (we could then use reload or AR::notice to reload some paths)
this dose not work for the following reasons
implementation and why
Recursive rdf files
rdf files allow for sublayers just like usd dose. this allows the follwing.
getRdf func
this funciton caches rdf files like a singleton would do. its wraped in a funciton like this to avoid common problems with named singeltons, this also allows us to create rdf files and modyfy them without having to care for the in memory instances.