Is there a possible way to hide all the routines that run behind the UI window so that if we send the program to someone else, all they can see is the UI window (or maybe one toggle and one object to open/close the window) and can operate it without being able to see the scripts running behind the scene?
Originally I thought just clustering everything would be enough, then I found that clusters don’t work for Human UI. But is there another way to do that? Ideally it would be something that looks like this but actually works:
Thanks a lot!!
yeah, clusters are not supported by Human UI. If you want to hide the “mess” you can minimize the GH window with a script: How to create a button in Rhino that launches a specific Human UI/GH script
If yuo want to get your hands dirty with code you can also create a button in Rhino that launches Grasshopper completely hidden and then launches your script that has a HumanUI – then you don’t even have to worry about the user being able to open the GH window!
I will add to Andrew’s response in that other thread to explain how.
I’d like to share my method. Just a combination of Andrew Heumann’s post described
- Serialize your HumanUI gh files into string format.
- You can encrypt the string or not.
- In a new gh doc, make a custom component, using the encrypted string as input, then in the component decrypt and the deserialize the string, run it in a new dummy doc.
The start gh file maybe look like this.
And You should properly deal with the close event of humanUI window created in the gh doc.
And recently I tried something David Rutten described here. It might be useful for calling another gh file which contains the humanUI components.
Loading a gh file, executing it and harvesting its data
I simplified my application a little and write a demo to illustrate my method.
Hope it helpful.BinaryAndEncrypt.gh (6.3 KB) HumanUI-source.gh (8.8 KB) HumanUI-bin.gh (10.4 KB)