Help on sop network strategy/caching implementation to break dependency of modifications.

   1073   0   1
User Avatar
Member
7 posts
Joined: 11月 2014
Offline
I have an issue when stacking up multiple independent modification in a sop network.
when done in the most simple streightforward way, it makes every modification dependent on every other on top of it and I need to exit this forced dependency with some kind of caching strategy and possibly dirty flagging just the modified node while adding its contribution live to the rest of the cached stack.
First removing the old contribution from the cache if present.

Let me explain it with a simple use case.
Say I have a mesh I want to add multiple displacements on it by attribute wranglers.
every wrangler calculates a displacement vector and doesn't depend on the displaced position of the wrangler before it they just depend on the original P of the undisplaced mesh.
naively I can link these wranglers together and apply the displacement to P in every node and pass the original P in the second input.
This naive link forces the cascade dependency with undesired cooking times.

Probably this use case can be optimized specifically, but I'm looking for a general solution as I need it for few similar use cases and possibly reuse it as a valuable tool during further R&D.

I immagined this pseudo design in steps:
  • save displacement vectors somewhere.
  • have a node to collect reference to these data, calculate and cache the displacement.
  • on parameter modification take the cached mesh and remove the old contribution flagging this node to dirt(in detail attribute) and make its modification live(view node = cache + live displacement).

Naturally if there was a previous live node collapse its vectors and unset the dirty flag before to set the new one to dirt/live and process it.

A key feature for this setup seems to be the Stash node that can be used to break the dependency loop and I guess you may put Python callbacks on parameters to track changes.
Sadly putting callbacks on all the parameters is suboptimal in my use cases.
I would love to have a general solution the more plug and play the better i.e. just specifying how and where to store, apply and revert a specific modification.

Please help me figure out as this is a key feature in a couple of tools I have trivially implemented that would improve a lot with this optimization becoming very interactive even in presence of a massive amount of “modifiers”.
Edited by Paolo Oliverio - 2018年11月22日 08:46:05
  • Quick Links