Speckle local server - Connection GH-Unity

I’m trying to develop an application in Unity and I’d need to get the geometry from Grasshopper. Unfortunately, using an online stream turns out to be too slow and, therefore, I set up the local server. How can I send geometry from grasshopper to unity offline, without having to upload and download it to the stream online? If I try to set http://localhost:3000/ as a stream input in Grasshopper, the send component cannot parse it properly (see image attached).

Cordially

Hi @MatteoWood!

Welcome to our community! Feel free to Introduce yourself 🙆 if you feel like it.

As for your question, the URL needs to point to a specific stream/branch to work, as we need to know the desired location of the data within a specific server:

  • http://localhost:3000/streams/YOUR_STREAM_ID (a stream url, defaults to the main branch)
  • http://localhost:3000/streams/YOUR_STREAM_ID/branch/YOUR_BRANCH_NAME (a branch url)

Either way, the stream needs to exist and the account you use in that machine must have access to it in order for it to work.

Fastest way to get these urls is to navigate to the specific stream page and copy the url from your browser.

Hope this helps! :wink:

In addition to what @alan has explained, your GH node if it isn’t passed an account will fall back to the default accounts for your environment. If you have already been using Speckle online then this may be defaulting to speckle.xyz

If you have a local server setup and you have an account added for it in Manager, you should be able to select that with the account selector. This can be used to confirm the local server connection also.

Thank you very much both for your answers.

Does it mean I have to create an account just for the local server? At the moment from Grasshopper I only see my account with my streams on speackle.xyz. How can I create one on localhost?

Thank you for the support.

Your local server should have a frontend just the same as speckle.xyz - from there the experience once you have an account of creating streams etc should be the same.

If you don’t have the frontend available there may be other steps you need to follow

Thank you, I managed to make everything work.
I had to rebuild the frontend package because somehow it didn’t display the login interface.

However, I must say the transfer speed didn’t change at all… Shouldn’t transferring data from/to a local stream be faster than transferring data from/to an online stream?

Cordially

This only depends on what the bottleneck is, if your internet connection is slow, using a local server will definitely improve things.

If the slowdown is due to the serialization / conversion / Unity API / etc instead there will be no difference.

What kind of data are you exchanging? Have you tried benchmarking each different step (download, deserialize, convert, create…)?

I’m sending geometry (approximately 5000 elements).

Should I somehow convert this before sending it in order to improve the serialization computational cost?
Maybe ~25 seconds it’s a normal time to live transfer that much data… What do you think?
In case, how could I benchmark each step of the pipeline?

Thanks for the help.