Cluster reference, how?

I’m trying to use clusters but can’t see how to link them between files, is there a way to do this?

I create a cluster in Grasshopper doc A and Export&Reference it to a file.
If I drag that file onto Grasshopper doc B, it appears as a component but its Properties are missing.
If I edit the cluster in A, it doesn’t update in B, likewise if I edit in B it doesn’t update in A. They’re not linked at all.
I can’t open the ghcluster file in Grasshopper, it returns “file_name is not of a recognized type”.

Clusters aren’t very useful if they can’t be referenced across different files. Is this a bug or am I missing something?

[Edit] OK I found the right-click/Update option in the cluster component. Guess I was just talking to the duck.
However the missing Properties are still a bug.
And updating is cumbersome if you have many such references. How about an “Update all clusters in this document”?

Thanks,
Bathsheba

1 Like

You can reference the cluster files from within different documents, but it only concerns the cluster logic, not the data inside of it.

Furthermore if the file a cluster references changes the cluster itself will continue to work in the old way, but its display will change to reflect it is out of date. You have to update the cluster manually from the cluster context menu. This is done so that the behaviour of existing files doesn’t change when someone (possibly someone else if the file is on a shared location) modifies the referenced file.

What do you mean by Properties?

Yes that could be added, clusters weren’t designed with the idea that you’d change the underlying files often, and that when you change them you’d want to make sure there’s no unforeseen side-effects, but if you trust yourself to make a bunch of changes and then apply them all at once, then a just-do-it-all button would make your life a lot easier.

Maybe clusters can have some option which treats them like a block?

When you right-click on a Cluster and choose Properties to set the name, nickname, description.
As set:

After export and re-import:

The name, nickname and description are lost.

Thanks for reading!

1 Like

That would be very nice!

Ah thanks, I’ll have to look into that.

1 Like

Hi is there any update in this topic.
IT would be great to have possiblity to update clusters. Manual update is quite tedious.

I understand logic of manual update but we are trying to use clusters as library for utility classes. And IT would be greate when we improve method to be sure we are using most updated version.

At my Company we are doing the same thing. Has there been any update on this process?

Yes I too would still like to see this

Just giving this a serious go and immediately notice (as the previous commenters) that this process is far from ideal.

From a UX perspective it is also far from well implemented. When I “Export & Reference” it does something for a while and then gives no visual indication that something has happened. Not even a slight icon change or a different color. First I thought nothing had happened and there are only 2 small clues:

  1. If you right-click on the icon there is now an option to “Internalise” that is no longer greyed out.
  2. If you hover over the icon there is now a path shown, but which is unfortunately cropped before showing the end of the filename. It also crops the first few levels of folders without adding … to make it a bit more confusing.

If you go to edit the cluster shouldnt it show the filename on the top rather than the same generic [Edit: Cluster]? How do I know which one I am editing?

How can I edit such a cluster? I cant find a way to open a .ghcluster file!? Do I have to drop it into a file first and then edit?

Here are some improvements that would make this much better to use in my opinion:

  1. Give referenced clusters a slightly different icon and color so they are instantly visible

  2. Allow editing .ghcluster files directly. In fact, all clusters should just open in a new GH window, so that you can edit a cluster and go back to the parent without closing it. Then once you update and save the cluster (by just hitting CTRL-S on it) and you go back to the parent it uses the same update mechanism as you have now for referenced clusters, where I have to either update a single cluster or a simple “update all clusters” as suggested.
    That way the workflow for editing referenced clusters and normal clusters would be the same and would be in line with most visual editing tools I have come across and would allow for clusters inside clusters and so on.

  3. There is also a Bug I just noticed: If you save a .ghcluster on a network file server and drag it into the grasshopper canvas, GH freezes for a good 5 minutes. It cannot be closed using Task Manager during that and completely hangs. Weirdly opening .gh files from a file server is no problem at all. I am curious how you do your file management at McNeel if not using a file server? Is it all Github/Dropbox/etc?

I really hope the area of clusters gets improved (also the bug where it re-calculates all cluster contents every time). Literally since day 1 of using GH many many years ago I noticed that clusters are just not up to scratch for anything other than small utility things, but are not a way to actually build modular patches as in other visual programming tools, so usually you just end up with one gigantic file with tons of wires going everywhere because nothing is in clusters.

1 Like

Update:

It might be easier/better to not export & reference clusters, but to use File > Create User Object, or so I thought.

You can then add your own Icon, names nickname, etc. Also I never noticed you can actually just type something yourself in “Category” and “Sub-Category”, so I have created a new category for our company.

We are already using Dropbox and Symlinks to sync both plugins and user objects across machines, so that will automatically take care of that as well.

Only thing I noticed is that if you have placed a user-object, then double-click to edit it and change something, next time you add the user object it will not be updated.

Is there a way to update a .ghuser file?

Also of course using this strategy you cannot replace a logic in Grasshopper, but will have to place the user object after saving it and reconnect all the wires.

It appears there is simply no good way of doing this right now. Both strategies are sort of half-way where they need to be, sadly.

Sorry for the many posts, but just thinking about this while playing around with it:

I think that “Export & Reference” and “Create User Object” should be the same process and should enable:

  1. if I create a user object I actually want to be able to set where to save or replace the file. There should be a file dialog opening and its automatically in the User Objects folder, that way I can select a file and overwrite it and also be able to create folders in User Objects.

  2. if I Export & Reference I would actually like to also put it in the User Objects folder, but there is no way to get to it since its such a cryptic and hidden folder

  3. if I want to update a .ghuser or .ghcluster component I would like to be able to just open it in GH and edit it. Then in any file that uses that component it can ask to update like it does currently. Basically a combination of .ghcluster and .ghuser functionality.

  4. I can right-click a user object in tab bar in GH and just click on “Edit”

  5. of course .ghclusters need to work if they are placed on a file server without blocking GH for several minutes.

@DavidRutten, what do you think? I saw in an old thread on the old forum you said something similar to this would be done for GH2. Is that still on track?

I just noticed that Blickfeld7, who had a plugin for GH was also using a lot of .ghuser files in the user objects folder.

Is the only way to get updatable clusters in the tab bar by effectively creating our own plugin and using .ghuser files in that? I guess plugins DO have a mechanism to update components if you update the plugin!?

Yeah, it’s all GitHub. Though clearly I need to get some network drives installed here at my office so I can test these things first hand.

Hm, I can’t seem to get referenced clusters to work.

So I created a Export & Reference .ghcluster in one file which contains a big part of a file. I then drop the .ghcluster in a different file that until now just had a copy of all the components from the other file.

Now I replace the whole logic with the .ghcluster file and connect everything back up.

If I change any of the inputs into the cluster all the outputs have either empty outputs or null in the case of the geometry output:

If I double-click on the cluster on the inside you can see all the outputs have data:

If I do Save & Close, now all the outputs have the same data:

But as soon as I recalculate all the outputs are null again.

So basically it was a nice little excurse and would have been nice, but neither referenced clusters nor updatable user objects are a thing yet, sadly, so back to the usual copy/paste between files to update them :confused: