Shout/hear BUG/discrepancy & wish

Premise: shout/hear component are fantastic.
I particularly love how it also works inside of clusters.
I have found a few discrepancies in how/if they operate, plus would be wonderful to have a couple extra functionalities.

Discrepancy 1: some components can listen to the shout if name is given as variable, other just don’t appear to be receiving it

Inputnotreading-ezgif.com-video-to-gif-converter

Discrepancy 2: somehow, if an input is connected after the expression is set to a shout variable, the input is ignored. I would expect the wired data to have priority, or at the very list a problem or alert to be displayed. Instead, the variable in the expression “just” takes priority.

Inputdiscrepancy-ezgif.com-crop

Wish: often times, a variable is used in multiple points across the definition. Instead of creating a slider, naming it for navigation and documentation, creating a shout component, naming it accordingly (but also as duplicate), then connecting individual listen blocks, why not give an option to a slider (maybe other inputs as well?) to just broadcast their value? Seems like a simple & clean enough implementation, reducing redundant interactions and streamlining components communication.

Hi Amebonini,

i was able to repeat both of these in the latest, and they turn out to be the same mechanism. An expression on an input is applied to the data that is already flowing into that input, item by item. A shout name in an expression is a variable the expression can read, but the expression itself is never a data source.

  1. That is why some inputs “hear” the shout and others don’t. An input that has a default value (like Circle Radius) has data for the expression to transform, so foo works. An input with no wire and no default (like Addition’s A) has nothing to apply the expression to, so nothing happens. The setup looks identical on canvas but the difference is the hidden default.

  2. Same reason the wired value loses. An expression that doesn’t reference x replaces every incoming item with the shout value, so the wire keeps feeding data and the expression keeps overwriting it. If you write the expression as x + foo (or anything using x) the wired data stays meaningful. To let the wire win outright, clear the expression.

Your expectation makes sense in both cases, and the slider broadcast wish is a nice idea. i’ll check with the team on making an expression act as a data source on empty inputs, a conflict warning for case 2, and the broadcast option. Filed the expression behavior here: RH-97888

Following @DavidRutten reply on the bug report,
“I don’t want the expression to become the value if there’s otherwise no value […] This sounds like someone trying to shoe-horn expression into a different role.”

I have to challenge this statement: I find the the use of a now existing global variable not only extremely useful, but also compatible with the nature of the expression field.

The way I interpret (correct me if misguided) the role of expression - as option in a component input - is “whatever is entering this input is altered this way” and it makes understandably crude to insert a global variable with the specific intention of ignoring/bypassing the potential input.

Still, this is a single-right-click-away field available on each input, capable of “altering the input in such way”. I can already see myself bypassing this by typing "x*0 + NameOfVariable, just out of convenience.

In Shout/Hear wish for Gh2 @antoinemaes describes what is essentially the same feature, albeit available as selection from list, trough an external “listen” component that needs to be called, placed, configured and connected to an input. A part from the fact that in a more complex definition with 20,50,100 global variables navigating the list would become cumbersome, the desired result is still four/five actions long instead of two (right click input + type variable name).

A special indicator like a dimmed pin or crossed pid could be used in these cases where the expression of a component was to be set as input-independent (easily detectable due to the lack of x).

At any rate, this feels like an extremely intuitive and effortless way to connect wirelessly, exactly how @Japhy describes in the GH2 Beta post ( Rhino Beta Feature: Grasshopper 2 (Beta) ):
“Globals without wires. Shout publishes a named value, and any parameter
expression downstream can read it by name. The dependency is real — move the
slider and everything listening updates — with nothing to route across the
canvas.”

I do really hope this gets a second thought :slight_smile:

…and @DavidRutten , your two cents on the auto-shouting slider?
(or any other input source if so toggled, given the chance)