Jump to content

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

 

Link to comment
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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...