I’ve got a GH script with HumanUI front end that is compiled using the Rhino Script Compiler and installing into Rhino 7 as a plugin. (Amazing!)
Everything in the plugin has been working great, exactly as it runs in Grasshopper, except no GH canvas shown.
In the last week or so I added some new functions, using a combo of Octopus and Anemone components.
This all works fine running on the GH canvas, but once compiled the functions kind of ‘fail to start’.
It appears to be related to the issues of putting these type of components into clusters.
Once compiled these looping type components are only run once per solution, they are not allowed to ‘free wheel’ and keep working while the rest of the GH has finished.
Has anyone had any luck getting these types of components working say under GH Player (which I believe has same single pass then exit issue).
One other possible solution is to move these functions out to Rhino.Compute using HOPS, however does Compute/hops have same single pass and exit issue?
Ok. So, again without any code or samples, its still a bit tricky to debug here. However, I did want to mention a few things. The default behavior of the GrasshopperPlayer was to actually keep the file open (even after it’s run). This was a decision made specifically for definitions that were using things like Human UI. We did recently introduce a new boolean toggle in the Document Properties which allows you to be explicit about whether you want to keep the document open or closed when running the GrasshopperPlayer command. This was only added in the latest Rhino 8 WIP… but you might try your files in Rhino 8 WIP and see if there’s any difference there.
I’m honestly not sure if looping is supported in general when run as a command. I haven’t test this in hops, so if you have a simple looping example you could upload here, that would be helpful.
Currently I use a Python script to ‘pre launch’ Grasshopper headless before running my compiled GH command. It’s the only way I’ve been able to get this 6000+ component def to run as a plugin.
To get the loop components to work all I had to do was launch grasshopper normally after my command/plugin/UI loaded.
Nothing in the grasshopper window, and in fact can close it straight away. But as long as non headless grasshopper has been opened, my plugin functions just the same as on the canvas.
@AndyPayne this option to close the command is very useful. I’ve been trying and it just works fine running the file with grasshoper player, by other hand when running the GH file from a plug-in, it doesn’t seems to work anymore. Do you know if this information is overwriten when generating the RHP with RhinoScripCompiler?
Here using both V7 and V8wip, thank you!
To my knowledge, the only place that looks at the checkbox in the GH Document Properties dialog is when the Grasshopper file is trying to be run as a command (ie. GH Player). When you compile your plugin and then try to use it on another computer, does it try to use the GH Player? Or is it running it in some other mode?
The commands are running with Grasshopper player, the main difference I found is that after compiled the plugin, these commands just perform well on the first run, after the first run it shows: No contextual outputs on the definition, even they are there.
By other hand, running the commands straight with GH player the same definitions perform well over and over again.
That’s why I believe there is a different way the scrips are handled internally.
Any advice would be greatly apreciated!