How to clear specific index of a Cache SOP from script?

   6955   0   1
User Avatar
Member
20 posts
Joined: July 2012
Offline
Hello again.

I'm trying to solve a slow user interaction problem in an OTL by using a Cache SOP and putting in my own values for its Index. I can store and retrieve the cached data just fine, the problem is how to tell that Cache SOP that index K has changed and needs to recalculate.

Is there a way to do this using either hscript or Python? The problem is there is no button on the Cache SOP GUI that clears a specific index. There's a button for “Clear All Cache” and for “Clear Current Frame Cache”, but I don't want to clear the current frame cache, I want to clear the cache at my specific index K. (Since this is happening within a Copy SOP and ‘index’ is stamped.)

I was thinking I would put a Python SOP upstream that checks if any stamped attributes for point number K have changed since last cook, and tells the downstream Cache SOP to clear the cache for index K. This should keep stamped geo for points other than K loading from cache, so that the user can interact more quickly. But I can't seem to find any exposed API functions to do that. (Even tried using Python's ‘dir’ on the hou.Node object for the Cache SOP, finding nothing so far.)

Anyone know if there's a way to do this?

(Edit) Note: The “Cache Stamping Geometry” option on the Copy SOP appears to do nothing in my case. Changing one instance still causes all others to also recalculate.
  • Quick Links