How to run a grasshopper definition from rhino compute with hops?

Hi all

As @AndyPayne wrote in a topic the definition of Inputs and outputs in grasshoper for rhinocompute with RH_IN: and RH_OUT: is the old way to interact betweend grasshopper and rhinocompute. @AndyPayne you suggest to use Hops instead. But how can we run a grasshopper definition in rhinocompute with hops?

Right now we use GrasshopperCompute.EvaluateDefinition(grasshopperFilePath, _inputDataTreeArray[i]);

Second question, is it possible that some plugins in Rhino are not compatible with rhinocompute? Is there a workaraound to run external plugins in grasshopper with rhinocompute? For example we get the following error using the plugin unifyUVs (it is saved as a gha file in the grasshopper libraries)

Error: CG [09:57:12 ERR] An exception occurred while processing request
System.NullReferenceException: Object reference not set to an instance of an object.
at UnifyUVs.UnifyUVsComponent.SolveInstance(IGH_DataAccess DA)
at Grasshopper.Kernel.GH_Component.Solution_Compute_MixedAccess(GH_StructureIterator it)

Thank you for your help
Silvan

We have several guides that discuss what Hops is and how it works. I would probably start though by looking through the Getting Started section of this guide.
Most plugins are compatible with Rhino.Compute. The main caveat that can sometimes cause issues in plugins is if they have some sort of special UI which requires some user interaction. This obviously fails on Rhino.Compute since it’s running in a headless mode and there is no UI. But, I can’t exactly tell why this particular plugin might be causing issues without really looking closer at the Grasshopper definition.

Dear Andy
Thank you very much for your help. I’ve checked all the Hops related guides and understand it in the context of grasshopper. It’s definitely a very good tool to simplify and speed up grasshopper definitions!

What I still do not understand, how I could call a grasshopper definiton from rhino.compute using Hops. I do not want to open a grasshopper definition to run via hops another grasshopper definition As I understand it is still necessary to call a grasshopper definition from rhino.compute with your named “old style” you named RH_IN: and RH_OUT: and GrasshopperCompute.EvaluateDefinition(grasshopperFilePath, _inputDataTreeArray[i]);
Is that correct?

For the second question, why not all plugins in grasshoper run in rhino.compute, I’ve uploaded a file that I can not run. What ist the best workaround to get it run via rhino.compute? I think in my large grasshopper definition are some more plugins used, that may use special UI.
What would you recommend to run such grashooper definitions with non-campatible plugins in rino.compute?
Plugin_not_running_rhinocompute.gh (12.7 KB)

Thank you very much. I appreciate the help in gerneral on this forum.
Silvan

Hops is merely a “client” which communicates with a backend “server” (ie. rhino.compute). So, hops was created as a simple way to be able to solve grasshopper definitions remotely via rhino.compute…but anything that can send/receive HTTP requests can be turned into a client that can communicate with rhino.compute. We have three libraries that we’ve created to help developers make their own clients depending on their software language preference. We have C#, Javascript, and Python libraries. We also provide a number of samples that you can review which shows different ways to use these libraries with rhino.compute. So, hops would be one way that you can send a grasshopper definition to be solved via rhino.compute… but you are free to develop your own solution depending on your needs. Does that make sense?

As for the second question… I thought I explained why some plugins might not work in rhino.compute. So, short of having the 3rd party developer update their plugins, it’s possible that not all components will be able to be used. That said, I did look at the definition that you posted and it looks like it’s using 2 plugins (Minimum Bounding Box and Unify UVs). I downloaded both from food4Rhino, but I still get an error message saying that it can’t find the plugin for Unify UVs. I downloaded version 2.0 of that plugin. Is that what you’re using? Can you send me a link to the plugin download page so I can use the exact plugin your wanting to use?