V8 Script Editor: questions re: publishing .gh

Hi all (especially @eirannejad ),

I am starting to learn how to publish my gh files to Rhino using this video.

Within my .gh file I have a Custom Preview component, so I can visualize what is happening. However, that preview does not work after publishing. Is there any way of previewing geometry before baking/completing the command? I have a workaround with Content Cache displaying locked geometry and clearing it once a proper bake occurs, but it is convoluted and - I think - unnecessary.

Also, my published gh file will only run once as a Rhino command. On the second attempt, Rhino tells me ā€œNo output contextual components in definitionā€. Iā€™ve added a ContextBake component, and a Brep component grouped/named as described here IN ADDITION to the Content Cache that actually bakes the geometry to Rhino. What am I missing?

Many more questions to come Iā€™m sure. This is a phenomenal leap forward for Grasshopper (pun intended)!

dh

And Iā€™ll add a few more questions:

When testing a published .gh file, my current workflow (again, using the above referenced video as a template) goes:

1 Create .gh file
2 - open Script Editor in V8
3 - Create project (*.rhproj)
4 - Right-click commands and insert .gh file (is .ghx better?)
5 - Save ā€œPlugin.rhprojā€
6 - Publish plugin
7 - drag & drop .yak file to Rhino
8 - test functionality.

I know Rhino will assign an id to the plugin, and that id cannot be overwritten. So, (hereā€™s the question) does that mean to ā€˜rev upā€™ the plugin I need to create a whole new .rhproj? Or just insert a gh/x with a different name?

Another question (unrelated): How are .gh plugins handled by this? If I use Pufferfish for example, then send the published .rhp to someone that doesnā€™t have Pufferfish ā€¦ what happens?

Again, really excited about this. Itā€™s something I always thought would be cool, but no way would it happen. Huge thanks to any & all that were involved.

dh

Bump! Just hoping to keep this thread aliveā€¦

Here is a very basic script that uses ETO and exhibits the behaviour described above.

  • No preview
  • If you close it and run again, it will say ā€œNo output contextual components in definitionā€

ETO_Basic4.gh (16.7 KB)
eto_basic4-0.1.15111.8895-rh8-any.yak (39.2 KB)

@declan The definition you shared above requries GG_UI_Designer that I can not find on food4rhino

Would you mind simplifying the solution to something that replicates the issue and does not use other plugins?

I am trying to understand what this Rhino command is expected to do.

To answer your other questions:

  • For publishing new versions of the plugin, youā€™d keep the id the same, and change the plugin version.
  • Third-party plugins can be used in your definitions. GH will popup a dialog asking to install those plugins when the definition is executed.

Thanks so much for the response. GG_UI_Designer is part of Grasshopper Gold. I am only using GG_UI_Designer in order to quickly generate an ETO window.

And I guess this is a case where GH doesnā€™t recognize all 3rd party plugins and prompt for install?

It did prompt me to install but seems like Grasshopper Gold is not available on Yak package manager so Rhino/GH can not automatically install that:

I guess you have to put in you documentation for end user to install this plugin manually.

Thank you Ehsan. I have replaced the ETO windows with Human UI windows and the compiled script does not have any issues running more than once! I will continue to poke around with ETO to see if I can find the issueā€¦

1 Like

Hello, Ehsan,

A followup question regarding ā€œversioningā€ a published plugin:

When I open an existing .rhproj file, add Grasshopper commands, and re-publish a .yak file with a new version number, Rhino tells me ā€œUnable to load plugin.rhp plug-in: ID already in useā€. The RUI does seem to update (the toolbar includes the new Grasshopper command icons), but the plugin is still running the original version.

Your plugin ID stays the same for the life of the plugin. Itā€™s version can change. Are you wanting to have multiple versions of the same plugin installed?

Perhaps Iā€™m doing something wrong, but I am not able to update an existing plugin. I must create a new .rhproj, and publish a new plugin (new ID).

Are you trying to update a plugin while it is loaded in Rhino? Would you mind sharing the error message? you can also run RhinoCodeLogs and DM me the contents