Caching within copy/stamp when point attrs drive copy geo?

   2309   0   1
User Avatar
Member
20 posts
Joined: July 2012
Offline
Hi! Hopefully I'm able to explain this clearly:

I have a homemade Python SOP ‘MKPOINTS’ that drops points with point attributes controlled by the user. There are 15-ish attributes on each point.

I also have a large network ‘BIGNET’ that constructs a complex geometry using those point attributes. This network takes about 2 seconds to cook.

These plug in to a Copy SOP that uses the point attributes in MKPOINTS to stamp attributes into BIGNET.

This is for procedural modeling. It works great for one or two points, but each additional point the user creates adds 2 seconds to the total cook time of the Copy SOP. This would be expected if every point had changed, but e.g. if the user has dropped 11 points and wishes to change one attribute on one of those points, that user has to wait 22 seconds for the Copy SOP to cook even though 10 of those 11 points have not changed.

Turning on “Cache Stamping Geometry” does not change the cook time in this situation.

One of the stamped attributes is the point number $PNUM of the point the user is working on. I tried adding a Cache node indexed to $PNUM, which does cache each stamp of the network. Unfortunately the Cache node doesn't notice when the other attributes have changed, so all attributes except Position stop working until the Cache is cleared.

Is there another type of cache node I haven't found that's suited for copy/stamp scenarios? Any other way to speed this up?

(Edit: Houdini 14.0)

(Edit 2): Just tried a Null with an additional attribute, which is stamped from one of the point values, plugged in to the second input of the Cache SOP, as a string. When the attribute changes and gets stamped in to the Null, it does not trigger invalidation of that index of the cache. :? So, no luck that route either.

Also thought, I could “hash” all of the inputs to an integer within MKPOINTS. Then set the cache index to that hash value. Problem there is, that would cause a new cached geo to be created and stored forever on every single edit, either growing the RAM footprint until either until Houdini is restarted or forcing the user to occasionally push a ‘Clear Cache’ button.
  • Quick Links