Set, Store and refresh an input? Remote Data Dam?

So I have come to a point, where I need a specific component that doesn't seem to exist.

Basically I have a set of components that is being recalculated all the time and that creates an output (just a certain sized box in this case). I want to hit a button to "set" that output so it stays the same, even when the components before it get recalculated. Then when I press reset it again looks at the connected input and uses that data.

In vvvv this is basically what a hold node will do.

The data dam is basically what I need, but I dont get why it has the button included in it, rather than having just a boolean input. Its one of those UI quirks, that dont really make sense - maybe they did at the time it was conceived. I need the data dam deep inside a cluster. It would seem silly to route the input and output up through the clusters just for the data dam.

Does anybody know if such a thing exists. Is there a workaround or plugin that has such a component?

Thanks for any help.

  • up

    Armin Seltz

    I just noticed 2 things actually:

    1) You cant route the input and output to the top to have a data dam there, as it assumes you are producing recursive data

    2) A data dam inside a cluster updates automatically every time you open the cluster, which it shouldn't.

    • up

      Anders Holden Deleuran

      It's pretty straightforward to write a basic data dam, which takes a boolean toggle, using any of the scripting languages (attached a GHPython version).

      20
    • up

      Anders Holden Deleuran

      Regarding: "Like being able to write true global variables (as in available to all open GH patches)" The Python sticky dictionary is really useful for this kind of stuff. It can be accessed from all RhinoPython editor instances (i.e. both EditPythonScript and GHPython) in the same Rhino session. I haven't tried reading/writing to it from within a cluster, but it don't see any reason why that wouldn't work. There's plenty of threads dealing with sticky if you do a search. Hope that helps.

      1