# Clusterhack

**URL:** <https://discourse.mcneel.com/t/clusterhack/116644>\
**Category:** Grasshopper\
**Tags:** windows, cluster, clustering\
**Created:** [January 20, 2021, 9:38am UTC](https://discourse.mcneel.com/t/clusterhack/116644 "2021-01-20T09:38:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Czaja](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/czaja/32/472252_2.png) [@Czaja](https://discourse.mcneel.com/u/Czaja)\
**Post date:** [January 20, 2021, 9:38am UTC](https://discourse.mcneel.com/t/clusterhack/116644/1 "2021-01-20T09:38:56Z")

</div>

Hi,

I would really like to be friends with clusters but they have some limitations.  
I know there is a problem with updating cluster outputs, some actions doesn’t update them.  
Is there any elegant solution for that?

In this example case, _Tap Buffer_ component is adding 1 every time I recompute the solution which is not forcing cluster output to update.

In the work scenario, I encountered this problem when I was dealing with changing Rhino object properties which didn’t force clusters to update - To be exact: receiving changing Rhino attributes (material) by _Object Attributes_ component from the Human plugin.

So far, this is what I managed to do, to force them to update.  
Enabling them by the trigger. (In the video I am mostly using F5 to recompute)

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/d/a/6dafd7864b12225183c6e673d10a8f89c26a6672.png)

[https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/d/f/1df9c498a9b19af66e8e74190e86d88d732cd19c.mp4](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/d/f/1df9c498a9b19af66e8e74190e86d88d732cd19c.mp4)

---

<div class="post-metadata">

**Author:** ![seltzdesign](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/seltzdesign/32/512215_2.png) [@seltzdesign](https://discourse.mcneel.com/u/seltzdesign)\
**Post date:** [April 12, 2021, 2:17pm UTC](https://discourse.mcneel.com/t/clusterhack/116644/2 "2021-04-12T14:17:56Z")

</div>

I actually have the same question. I keep noticing that I have clusters where the output doesn’t update properly unless I open and close the cluster. Even recompute sometimes doesn’t update them.

Also how can I just force a recompute in GH by pressing a button? I am mainly using components from V-Ray and some other plugins that do asynchronous stuff (like writing to a Google Sheet and renaming some files).

This is where you quickly learn that GH is not that useful if you want to hijack it for any general tasks that don’t necessarily produce an output in Rhino.

---

<div class="post-metadata">

**Author:** ![Czaja](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/czaja/32/472252_2.png) [@Czaja](https://discourse.mcneel.com/u/Czaja)\
**Post date:** [April 14, 2021, 10:24am UTC](https://discourse.mcneel.com/t/clusterhack/116644/3 "2021-04-14T10:24:29Z")

</div>

> [@seltzdesign](#):
>
> Also how can I just force a recompute in GH by pressing a button?

Do you mean the F5 key?

* * *

I did a little test and Hops component seems to not have the same problem with updating as Clusters do, but I’m not sure if they should be used this way.

I prefer spaghetti served on a plate instead of a canvas, so If I am looking only for tidiness Hops are a bit of overkill. Also, with Hops, you got two GH files instead of one to make your definition running, so in some cases, it can be impractical and prone to human error.

Hops can be great but properly working clusters are also needed.

---

<div class="post-metadata">

**Author:** ![seltzdesign](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/seltzdesign/32/512215_2.png) [@seltzdesign](https://discourse.mcneel.com/u/seltzdesign)\
**Post date:** [April 14, 2021, 3:52pm UTC](https://discourse.mcneel.com/t/clusterhack/116644/4 "2021-04-14T15:52:19Z")

</div>

> [@Czaja](#):
>
> Do you mean the F5 key?

No, I mean a button (ie. boolean) in Grasshopper. I want to be able to trigger a recompute, since some components are not updated correctly if they are not connected to visual output downstream. I have a python component that outputs the current time and this doesn’t update unless I do a full recompute (by pressing F5).

---

<div class="post-metadata">

**Author:** ![Czaja](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/czaja/32/472252_2.png) [@Czaja](https://discourse.mcneel.com/u/Czaja)\
**Post date:** [April 14, 2021, 4:39pm UTC](https://discourse.mcneel.com/t/clusterhack/116644/5 "2021-04-14T16:39:47Z")

</div>

That’s what I thought but asked anyway. Maybe a workaround would be using Metahopper to toggle enable/disable specific components and force them to update this way?

---

<div class="post-metadata">

**Author:** ![attheeast18](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/attheeast18/32/613217_2.png) [@attheeast18](https://discourse.mcneel.com/u/attheeast18)\
**Post date:** [April 14, 2021, 10:48pm UTC](https://discourse.mcneel.com/t/clusterhack/116644/6 "2021-04-14T22:48:53Z")

</div>

Same here. I’m experiencing many problems right now. Firstly, many times they don’t update and I have to edit my cluster, delete the output node and then replace it with a new output node. Secondly, when I use plugins like elefront and streamline blocks as output, everything is displayed correctly in Gh preview but won’t bake. And if it does successfuly bake, it only bakes a few blocks, sometimes it even results in wild displacement of blocks. It’s so buggy; this should be fixed quickly.

---

<div class="post-metadata">

**Author:** ![AndersDeleuran](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/andersdeleuran/32/476683_2.png) [@AndersDeleuran](https://discourse.mcneel.com/u/AndersDeleuran)\
**Post date:** [April 15, 2021, 7:21am UTC](https://discourse.mcneel.com/t/clusterhack/116644/7 "2021-04-15T07:21:09Z")

</div>

> [@seltzdesign](#):
>
> No, I mean a button (ie. boolean) in Grasshopper. I want to be able to trigger a recompute …

You can try this:

> [@Rhino- Precompute grasshopper python script](https://discourse.mcneel.com/t/rhino-precompute-grasshopper-python-script/114713/6):
>
> The following seems to be a nice simple way of doing this. If anyone knows if this will cause any problems, please let me know: import Grasshopper as gh gh.Instances.ActiveCanvas.Document.NewSolution(True)

Or this older solution:

> [@Recompute Button](https://discourse.mcneel.com/t/recompute-button/82094/8):
>
> I was just in need of this myself (for a one-click Recompute Solution from the RCP) and ended up here. I’m not sure if this GHPython approach (based on David’s advice above) would be considered super correct, but it does appear to do the trick: def ghSolutionRecompute(): """ Recomputes the Grasshopper solution (ala pressing F5) """ def expireAllComponentsButThis(e): for obj in ghenv.Component.OnPingDocument().Objects: if not obj.InstanceGuid == ghenv.Compon…

---

<div class="post-metadata">

**Author:** ![seltzdesign](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/seltzdesign/32/512215_2.png) [@seltzdesign](https://discourse.mcneel.com/u/seltzdesign)\
**Post date:** [April 15, 2021, 9:10am UTC](https://discourse.mcneel.com/t/clusterhack/116644/8 "2021-04-15T09:10:51Z")

</div>

Yeah, that was a great suggestion and seems to work great for my usecase:

 ![expire_object](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/f/5/8/f5848f3be4dcafda9038dfb48649b9c6942c8d71.gif)

@AndersDeleuran thanks for the links, I will probably need those at some point too.

---

<div class="post-metadata">

**Author:** ![lolrazh](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/lolrazh/32/604368_2.png) [@lolrazh](https://discourse.mcneel.com/u/lolrazh)\
**Post date:** [September 13, 2022, 2:03pm UTC](https://discourse.mcneel.com/t/clusterhack/116644/9 "2022-09-13T14:03:54Z")

</div>

> [@seltzdesign](#):
>
> Also how can I just force a recompute in GH by pressing a button?

Have you tried using the Data Dam Component? I don’t know if that’s what you’re talking about though.

---

<div class="post-metadata">

**Author:** ![seltzdesign](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/seltzdesign/32/512215_2.png) [@seltzdesign](https://discourse.mcneel.com/u/seltzdesign)\
**Post date:** [September 13, 2022, 2:42pm UTC](https://discourse.mcneel.com/t/clusterhack/116644/10 "2022-09-13T14:42:05Z")

</div>

I do know about it. It is not what I was after. I was thinking about how I could trigger a recompute (the same as pressing middle-button and selecting “recompute” from the menu. But I wanted to do that using a button in GH.

I am sure there is some way to do it using script components.
