Hi there,
I was trying to use a definition with some Speckle nodes via Hops, and it doesn’t work.
I was assuming that because the Rhino Instance launched by Hops is local, it was able to pick up all the plugins installed (with some of them, hops works).
Do you have any possible ideas/solutions?
Cheers.
Hey Mirco,
There are a couple of issues I was able to dodge to use Speckle with Hops/Rhino.Compute. It would be helpful if you could attach a sample definition and some screenshots of the errors you are getting and also from your rhino.compute console window.
Welcome to the community.
Hi Victor,
attached is the definition colled into hops.
HopsTest.gh (10.1 KB)
here the screenshot from RC.
Let me know if you need more information.
Thanks
Looks like GeometryGym is waking up, although I do not see any GeometryGym components on your definition.
Am I missing something here?
If you are not using GeometryGym, you might want to disable the plugin, restart Rhino and see what happens.
I don’t think GG is creating the problem, because the input and output point in the definition works and if I remove all the Speckle nodes still working, even if I have that error.
I removed GG, so I don’t have that error.
And this is the error I got.
Hey there! I think I know what’s going on here…
If i remember correctly, hops
cannot output anything that is not a “primitive data type” from Rhinocommon. So any base object will end up as empty
when the component runs.
Your attempt at serialising/deserialising is good but, it turns out those are some of the last GH_AsyncComponent
the connector has. These don’t play nice with compute, as it expects a single solution to be executed. I guess we could convert them to TaskCapableComponents
if there’s a need for it.
So basically, for different reasons (some ours, some McNeel’s) none of your examples will work .
While we discuss if/when we change these components to be TaskCapable
, you can hack your own Serialise/Deserialise nodes using a super short c# script!
Serialise to JSON
Deserialise to Base
Remember to setup your c# script as instructed in Grasshopper | Speckle Docs
And here’s a quick demo I did to check if it worked (you’ll need to re-reference the dll’s in the c# scripts)
https://drive.google.com/file/d/1ogvvwDehyV7gwcVQZYMmYg-qALAwWLHW/view?usp=sharing
Hope that helps!!
Here’s a colorful collection of hacks including @AlanRynne’s that might help you get going.
Choose a hashtag #MakeSpeckleSyncAgain or #RhinoComputePleaseAwait (@McNeel)
hops-speckle-hacks.gh (10.7 KB)
Awesome! Thx @vwb!
My hashtag of choice would be #ReleaseGrasshopper2Already! haha but we can #MakeSpeckleTaskCapable haha which is better than just Sync
Edit: LOL, I replied to myself instead
I opened an issue to keep track of the change:
Firstly thanks @AlanRynne and @vwb
If i remember correctly,
hops
cannot output anything that is not a “primitive data type” from Rhinocommon. So any base object will end up asempty
when the component runs.
Yeah, Alan this is why I tested the serialization, but I didn’t know the problem with the new component, also I tried using the C# component to avoid the use of the plugin, so I was close, but I missed the last bit
Thanks, Victor for the example!
@AlanRynne regarding your demo, it works passing a string (the CSO component doesn’t fail) but if passing a point for example won’t work, so for a complex object is better to use a C# component.
Hi,
not sure if you ran into a similar problem back then as well, but I have to create a RhinoDoc (by adding a boolean input, see attached example) if we want to run Speckle nodes inside a hops component:
if cloud:
my_doc = Rhino.RhinoDoc.CreateHeadless(None)
Rhino.RhinoDoc.ActiveDoc = my_doc
else:
my_doc = Rhino.RhinoDoc.Create("Sample")
Rhino.RhinoDoc.ActiveDoc = my_doc
Also I noticed quiet poor performance, Grasshopper seems to crash randomly once i am trying to do more complicated stuff/sending bigger models to rhino.compute.
Someone any tips or watch-its regarding those issues?
I didn’t keep investigating this solution in particular, because having C# nodes with dependences is not a sustainable approach.
But I remember in terms of performance was working very well.