How to make a reference or instance of a component?

is there a way to create a duplicate (instance or reference) of a component in grasshopper that always has the same values as the original component? this would make GH workflows less cluttered as you could make an instance where the component is needed instead of having to drag a wire across the whole workflow.

Example: I want the number_slider_A to be mapped to circle_radius_A AND square_height_B. rather than connect number_slider_A to both circle_radius_A and square_heigh_B, I would connect number_slider_A to circle_radius_A, and create an instance (number_slider_B) of number_slider_A and connect number_slider_B to square_height_B.

this way any time i change the value of number_slider_A, number_slider_B would reflect the same values wherever it is in my workflow.

does something like this exist?
I thought of this as in davinci resolve fusion, it also uses node workflows and it makes life much easier. Davinci Resolve Instances Example

Sounds like Telepathy will do the job for you?

1 Like

Hi @Mate ,

The cleanest way I’ve found to do this is with a plugin called Telepathy.


Telepathy Example.gh (7.0 KB)

Edit - dang, @Kyuubimode beat me to it! :smiley:

2 Likes

I haven’t used Telepathy but what you describe sounds like the same problem as hidden wires that make GH code harder to understand. I wouldn’t hold your breath for this feature. :-1:

1 Like

You can definitely make a mess out of overusing telepathy if you don’t keep a proper track of it. I find that it is good practice to use it sparingly. I only use it for user input values and data generated mid-workflow which you know isn’t going to be modified later on. If you have R8 try using model object user attribute text to store data and such on objects upstream and retrieve it back downstream when you need it. It helps cull the spaghetti.

Sounds like good advice. I never use hidden wires (or relays) and rarely use faint wires.

1 Like

looks like telepathy is what i’m describing. though i am curious, why is it considered bad practice to use instances to help keep values consistent in other areas? i can understand that it can get hard to track with larger projects, but is that much better than spagetti workflows?

I’m still new to rhino and GH as a whole, so this is definitely my inexperience talking, I’ll have to look into what model object user attributes are.

Have you tried hidden wires? My experience is that default wires are superior.

That’s what wires do. Double wires and dashed wires convey important information about data that flows through them. Try hidden wires for awhile to see what Telepathy feels like.

Is this really better than wires, hidden or faint?

Experience has led to the default wires.

1 Like

Its fine when your scripts are small. But when scripts start growing large and multiple different data streams need to talk to each other, relying on telepathy breaks the visual graph logic. I found it extremely easy to also just misplace stuff on the canvas and end up creating recursive logic. After creating many huge scripts (1000+components) I now rely on other tools like clustering and model object user attribute text to make sure that I can understand and remember what the logic is and how data flows whenever I re-open old projects. Also, I am not defending spaghetti workflows either, rather there are other ways the keep the canvas readable which does not break the visual data flow.

When it comes to making one-off objects or something like 3D printing I abuse the hell out of telepathy. But when working on large projects like architectural facades or detailed custom tools to be used inhouse at our studio, I rarely rely on it - just for initial input and nothing else.

1 Like

As to whether it’s better than hidden/faint wires, to each their own.

In larger definitions (especially where I’m passing them around the office) I’ll tend to have a ā€œcontrol panelā€ of inputs in the upper left corner, and treat those sort of like ā€œglobal variablesā€, using Telepathy to bring them where they’re needed in a definition. The control panel really helps, because the next person to use my script doesn’t need to review all of the components of the definition, they just need the control parameters and a Bake/Push/ā€œDo this taskā€ button to use it, and the rest can be off to the side.

A good example from my use case is something like material thickness for the sides of a cabinet. I’ll create a number slider up in my control panel area, and connect it to a Telepathy Sender with the name Cabinet.Gable.Thickness, or something along those lines. Every time I need to reference that value (maybe there’s 17 different styles of cabinet, but chances are good they’re all using the same material across a project) I can just duplicate and connect a Cabinet.Gable.Thickness receiver to an extrude distance.

1 Like

Clear visual layout on the ā€œcanvasā€ is great, but how is Telepathy better than hidden/faint wires?

I second this question.


My usual workflow:
params
CTRL-C copy something
CTRL-SHIFT-V paste something in current camera canva position

CTRL-Left or CTRL-Right to navigate to the linked other component.
(you can’t do this with telepathy, i guess…)

One of my current definitions has around 5000 components. I use relays on many wires simply because I can name them and have a human readable description on both ends of a wire and I can jump back and for by selecting a relay and pressing ctrl + arrow left or right

1 Like

It’s not a huge improvement, I guess. I’m sure there’s use cases that I’m not aware of - at least for me, it’s nice to be able to drop a receiver (or sender) down and right click to select the key value I want to link to.

Its just the QOL features for me. You can find and replace receiver+sender names and also change the receiver name which will dynamically link to a different sender. There’s also the simple action of double clicking a sender to spawn a receiver. The blue color also helps to distinguish ā€˜Global Variables’. Also the wires are already hidden by default.

1 Like