Jump to content
friedasparagus

Caching Data between cooks

Recommended Posts

Hello out there,

I've been taking a good hard look at the SOP_NodeVerb API, and was wondering whether anyone had any pointers on best practices for calling certain functions only when the input geometry has changed. In my case this building a GEO_PointTree and a GEO_DetachedHedgeInterface, the result of which I've been storing in the subclassed SOP_NodeCache.

I managed to get something working using COOK_GENERIC and DEP_MicroNode to check when the input node had last been visited to decide whether or not to run cookInputs() and update the cache. But it feels hacky and horrible :unsure:

There's a strong possibility that I've over-complicated things here, and just wanted to reach out in case anyone had any 'patterns' to hand for this before I go down any other blind alleys

Cheers!

Henry

 

Share this post


Link to post
Share on other sites

Does the SOP_WindingNumber sample not show what your looking for? 

A GU_Detail is a collection of attributes(like a position attribute but also for topology) so when your asking if a geometry has changed, your really asking what attributes in the GU_Detail have changed.  All attributes are tracked with GA_DataId, so caching the data id of the attribute you're interested in and checking that against the incoming geometry will allow you to check for any relevant changes.  The SOP_WindingNumberCache::update3D function in particular seems to show a way to do what your describing.

  • Like 1

Share this post


Link to post
Share on other sites

Ah, thanks MrScienceOfficer! I think I've looked at the same thing for too long and stopped actually seeing... That does indeed look like what I was looking for.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×