Avoid passing on update when changing a value to a duplicate value

Hi!
I have a definition with three modes, controlled from a drop-down value list. Some parts of the script run in both mode 2 and 3. When changing between these two, both will pass on a True. This controls stream gates and Metahopper components that enable parts of the scripts later. The problem is that when a new True value is passed on, a lot of things will recalculate, even though all values will be the same. How can this unnecessary recalculation be avoided?

I have attached a simplified definition, where the Data recorder symbolizes the parts that come downstream. The goal is to not have a new “True” show up when switching between Mode 2 and Mode 3.

As far as I know Data dam is the only component that can completely stop any update/recalculation to pass through. I have tried to control it with Metahopper, but with no luck. I am not so familiar with C#, but maybe there is some solution there?


Trying to avoid passing on an update.gh (5.2 KB)

Hello,

Not sure this will be usable in your entire file, but it seems to work.
I use Metahopper’s component to get the active value of a Value list. However - don’t know if it’s intended or a bug - this component needs to be expired manually. So, I also use the Expire Object component to activate that update, only in the case where at least the current of the previous value of the value list is 0 (it should update if you switch from 0 to non-zero, or vice-versa).

AsyncUpdate

For the record, the Data Recorder and Equality component of the bottom should be inverted…

Trying to avoid passing on an update.gh (12.7 KB)

Hi,
I will try to integrate it in the large file tomorrow, but from testing it now it seems to do exactely what I have been struggling with! Thank you Teddy!

Hello, is this what you want?

Hi Toto,
This is not what I mean. Magicteddy understood it exactly right. The resulting output of the three selected modes are not to be changed, what I want is to only to avoid passing on two consecutive “True” values.

Your solution worked perfect when I implemented it in my script Magicteddy!
This will save me a lot of computing time :slight_smile:

I found another situation in my definition that also caused unnecessary recalculations.
If I simplify the situation I have two toggles that control the same thing, that should run if either of them is True. The problem here is the same as before, that two consecutive True values cause recalculation. I swapped the “Get List Data” to a “Get Param Data”, to read from a Boolean instead of a Value list. In this case it is great that these components doesn’t update automatically!

1 Like