Search - User list
Full Version: force USD File Import to reload
Root » Technical Discussion » force USD File Import to reload
Numai
Hello,

we use a USD File as a database to store a bunch of assets and I want to reload the USD file to refresh the data contained when we notice the asset path has a more recent version on disk. The Database update is a separate process that works quite well, so I only need to reload the import on filetime discrepancy between the database and the updated file, shouldn't be too difficult I thought.

Well, apparently I houdini caches really aggressively which seem to prevent automatic date evaluations of local files so I've learned more about how houdini executes graphs, evaluates changes and how to force it with python to cook, create depenedencies and trigger updates, yet it doesn't work on the USD reload.

I think it is because the check is cached after the first run and houdini/python uses the cache result not checking files on disk anymore. It is surprisingly complicated to find a proper solution to get nodes dirty, sometimes it works but due to recursion can't stop but when implement proper interruption it doesn't run a second time.

In python I a bunch of methods node.cook(force=true), node.invalidateOutput, hou.hscript("clearcache -all") and other cache clearing methods in houdini and USD in hopes that it starts anew, I've also read about an incremental count where I run into permission errors because it runs inside a locked node, etc, etc.


The import hda with it's checks is embedded on multiple occurences in a larger node structure and within loops which in itself is instanced through houdini engine for other tools to use.

Does anyone have ideas or have encountered similar issues? I'm pretty much running out of ideas and in circles
Tanto
We had a similar problem and found that bypassing/unbypassing the usd import node was the only reliable way to update.
Numai
You to mark the USD import as bypassed? Hm, that sounds like a hacky solution I didn't consider yet, thanks.

For now I worked around the issue by separating the file processing and USD import from each other so I have only one USD import outside of the loop and that seems to run smoothly.

I have to admit that I was bit surprised since I also removed my python nodes and suddenly it worked, atleast outside of for loop nodes. Now I only check the database time in a vex wrangle and a few channel references. I assume it's one of the python channel expressions to retrieve the disk database time and USD cook time that returns always new values which trigger a database import, but that requires proper research for which I don't have time at the moment.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB