Running Speckle on Rhino Compute

Hey there,

Looking to start a project in the new year and our modellers want to use speckle for data management.

We’ve had issues in the past where our computational designers have become a bottleneck on projects, so I’d like to set up a system where, if possible, our grasshopper scripts are run automatically whenever the modellers push updates from Rhino - current thought is:

  1. Modellers model
  2. Modellers push to speckle branch A
  3. Our server listens for the push
  4. A rhino compute instance runs, pulling the changes from branch A, doing work, and pushing to branch B
  5. Modellers get a email when work is ready

Most of that is straightforward, just giving you the full context. The main question I have at the moment, whats the best way to set up speckle to get this to work? Is this even an intended use case for speckle?

One immediate issue I’ve had is that the Synchronous Reciever node is throwing exceptions when it is called within a rhino compute instance:

An exception occurred while processing request
System.NullReferenceException: Object reference not set to an instance of an object.
   at Objects.Converter.RhinoGh.ConverterRhinoGh.SetContextDocument(Object doc)
   at ConnectorGrasshopper.Objects.SelectKitTaskCapableComponentBase`1.BeforeSolveInstance() in C:\Users\circleci\project\ConnectorGrasshopper\ConnectorGrasshopper\Objects\SelectKitTaskCapableComponentBase.cs:line 142
   at Grasshopper.Kernel.GH_Component.ComputeData()

This seems to be a reference to RhinoDoc.ActiveDoc which has been identifed as an issue in converters: Pull 749.

That being said I don’t want to dive into bugfixing if this isn’t the right direction more generally…

Interested to hear if anyone has been down in this road before and give me some pointers about where I should get started.

2 Likes

Hey Chris,

This is definitely a scenario we want to support via Speckle. Our long term vision on this would look a bit like GitHub Actions, see this thread by @messismore : :robot: Speckle Actions! Suggestions?

Currently, I think what you describe could be, at least in part, possible via Rhino Compute, but I’m not too experienced with it, so I’ll ping some folks who might be able to help you some more: @Stam who created the Synchronous Reciever for use in RC and @vwb who I believe fixed the issue you have with the ActiveDoc (maybe you have an update pending?).

2 Likes

Cheers Matteo, yes I’d love to get input from people familiar with the codebase - I branched it and started making a mess but got about an hour in and decided I was just creating more problems (as I shift in my day-to-day from programming to management this is happening to me more and more :grimacing:).

Hey guys

I got stuck just 1 step ahead as you @chris.welch. My PR fixed the issue specifically on the Converters, but there are more places where the components are assuming there will be an ActiveDoc (e.g. the SyncReceiver).

I believe if you choose “do not convert” you will walk one step further. The thing is now you will need to convert things manually, that’s very possible and there are examples on the forum (Speckle nodes and Hops - #7 by vwb).

image

What is not possible, yet, is to disable the conversion on the SyncSender. Meaning you will stumble on the same exception if your workflow needs to send anything back to Speckle.

I had to drop working with this for a while, but intend to come back and contribute if more people are interested.

Would you look at that! Thank you very much for the pointer @vwb!

You’re right though that we can’t actually write anything back to speckle without specifying a converter and speckle trying to ping the rhino doc and crashing. It’d be great to be able to fix as this would unlock so much potential in the short term - I’d like to hear @Stam’s thoughts on how the nodes are working currently…

1 Like

Just looking into this further, it looks like this is going to be a pretty major stumbling block for using Speckle with compute:

Grasshopper Best Practices for Rhino Compute? (discussion) - Rhino Developer / compute.rhino3d - McNeel Forum

image

So that affects the coverters and the connector itself, looks like there’s references to RhinoDoc.ActiveDoc all through the codebase. Based on the warning at the top of the API docs ( RhinoDoc.ActiveDoc Property (rhino3d.com)) you’ll also see this causing issues on Mac in the future.

1 Like