Simple asset resolver

   1586   3   2
User Avatar
Member
65 posts
Joined: May 2009
Offline
Hi there Everyone,

I ran into the known problem of overwriting USD files on a SMB share that are open in other sessions. We decided to switch from a simple push-pipeline to a pull-pipeline to avoid overwriting files all together. To make life easier I'm looking for a solution where if there is no version number at the end of a referenced USD filename a script would look for the newest version present and read that. We tried symlinks but SMB clients are not allowed to create symlinks on SMB shares, so we wouldn't be able to update them on the client side. Writing a proper asset resolver in C++ seems to be an unproportionally big task for such a simple task.

Is there any other way I can do this transparently so I don't have to implement it on every LOP node that reads USD files into the stage?

Thanks in advance,
Mate
Edited by gadfly16 - Oct. 11, 2022 07:53:19
User Avatar
Staff
4438 posts
Joined: July 2005
Offline
If you don't want to address this at the LOP level, then you have to address it at the USD level. If you want to address it at the USD level and not write a new asset resolver, then there has to be a file on disk with the unversioned file name. If you can't have this file on disk be a symlink, the only other solution I can think of would be to write an SdfFileFormat plugin that reads the unversioned file by opening the latest matching versioned file name in the same directory. Note that this means the unversioned file must exist on disk (though it could just be an empty file), and it will have to be given a unique extension so USD knows to use your file format plugin to load it.

The implementation of such a file format plugin shouldn't be very difficult, but it's hard to say if it would be easier than writing an asset resolver (which I think is really the cleaner way of doing this).
User Avatar
Member
65 posts
Joined: May 2009
Offline
Thanks!

Yes, it seems that the asset resolver is the intended way of doing these kinds of things, and I certainly would start to write one if I would have the time and resources.

Anyway I would happily do it in LOP level. In fact I was hoping to get informed that there is something like this in LOP level, something along the lines of output processors, but for inputs. Otherwise I can only imagine doing it in custom HDA-s that wrap the functionality of the sublayer and reference nodes. But that way I would probably loose the stage manager.

If you know about any resources of information about writing ARs without extensive C++ experience I would be grateful!

Thanks again,
Mate
User Avatar
Staff
4438 posts
Joined: July 2005
Offline
To do this at the LOP level, I think you'd have to use HDAs, and as you point out, you'd lose the ability to use some nodes directly (like the stage manager).

As for resources to help with creating asset resolvers, there are a couple of open source asset resolver projects out there. I'm not sure if any of them work with the "Ar 2.0" library that Houdini 19.5 uses. But the "starting point" I've heard of people using most often is the "replace resolver" originally written at RodeoFX.
  • Quick Links