Rhino Web Browser as UI for GH - proof of concept

SO, I’ve managed to borrow an old Mac Mini and get it updated enough to run Rhino for Mac.

A few little jump around and I got THIS:

I needed to manually load Metahopper for Mac as the Package Manager only wanted to install the Rhino version.

Then the Webkit Browser was not loading from localhost, solved by telling it to go to 127.0.0.1:port.

Very very stoked to get this far!

Oh - I did think the Bengsht webserver at some point was not compatible with MacOS but after going down a bit of rabbit hole of making my own Python web server I worked out it was not the issue I thought it was.

Looks like the job of replacing my HumanUI front end it coming up quickly.

Cheers

DK

2 Likes

So, built a simple app and ran it thru the Script Complier to get a .YAK file.

Couldn’t figure out a drag and drop install for Rhino for Mac, but did manage to get the right files into a folder to launch from the command line:

No menu items yet, and my current Windows launch script puts some ini info into a local folder which is not a valid MacOS location so need to have a think about that.

Does anyone know how to setup drag and drop YAK file installs for Rhino for Mac?

But not bad progress for an evening.

Cheers

DK

230823_DKUI for MAC test.gh (22.7 KB)
Code attached for anyone that wants to see how the test was setup:

2 Likes

So, after a bit of work porting my code base, I’ve got my plugin source code somewhat opening on Rhino for MacOS:

Still a bunch of stuff I need to sort out.

One ‘gotcha’ is I use rs.PropertyListBox() user interface in a few places to edit tables of settings AND this is one Rhino Script Syntax item that has not been ported to MacOS.

Not a road smash, as I this was actually a bit of hack to get around HumanUI’s lack of editable Tables of settings. Looks like doing this directly in the HTML interface will be somewhat easy.

Couple of other weird things going on on opening at the moment, but I’ve not cleaned all the HumanUI code out yet so can’t read much into that for now.

Pretty happy that all the GH plugins I use are working too.

Cheers

DK

1 Like

And same code on Windows:

2 Likes

Editable tables of parameters sorted, this code is ugly, mostly due to needing backward compatibly with save files, but it does work.

Cheers

DK

3 Likes

So 8 weeks later I’m here:

KaroroCAD on Rhino for Windows:

KaroroCAD on Rhino for MacOS:

To say I’m happy is an undershot by a big margin - this is fricken COOL!

Everything is working pretty much as per my HumanUI/Windows only version, with only a couple of features I need to work on.

Shipped out production windows versions this morning, should have my first Mac user next week.

Cheers

DK

4 Likes

Can’t forget my WING design tool too:


t

1 Like

Thank you for sharing this evolution. How is it faring now after a year? Basically I am in the same position. I have a robust Human UI interface running. I don’t have a platform issue because Mac M3 with Parallels can easily use all of the plugins we need without too much compromise.

But with Human UI itself I am at a point where the interface rebuilding adds overhead when starting up the script so now I am interested in decoupling the interface from the main script. All I need is a way to transmit data values from ui to grasshopper. And vice versa if it helps.

Because one thing that Human UI cannot do easily is load up preset values from an external file or save value presets to a file. People have found ways but they are work arounds at best.

But I only know enough Python to automate basic stuff and understand code structures. Can you share some suggestions if HTML is the way to go? Can a framework help in making conditional inputs? (hiding sliders based on other inputs etc.)

Hi Muhammad,

I’m more than happy where I’m currently at with this UI solution.

All I’ve really done with it in the last year in terms of development is turn each of the UI elements into a cluster so I can update the python code in all of them on the canvas at once if needed.

I’ve got a new CNC/Gcode plugin coming out soon that uses this UI, the second product I’ve developed with it.

Details are here:

I use the same method for file saving and reloading as detailed in this thread/discussed with you in the past:

I don’t really consider it a work around - the whole system state is purely based on the state shown in the UI, which in many ways should be how its done.

I dont use any HTML frameworks at this point, I believe there are others who are using ETO.Webview UI’s in Rhino that are built around web frame works, but this is beyond the scope of what I need.

However I do hide/show elements based on user input where needed, here I only show the engraving bit angle when an engraving bit type is selected from a drop down menu:


This is done with some GH logic and Stream Filter components - the whole UI page is reloaded on each user input so its easy to create these sorts of functions.

Cheers

DK