GUI - Rhino - Radial Menu - Cross Platform

@mrhe I would love to and that does make sense with the Display.Pipeline. I hadn’t tested anything in a large model yet but those are the kind of models I would typically be working with so performance is definitely important in that regard.

I think the community would really appreciate and benefit from such a tool. I’m only one user but I’ve always been interested in ways to “speed up” interactions with the UI/UX in Rhino. It’s a powerful software but aliases can only go so far and I find myself often wanting a contextual UI that is directly in the viewport related to what I am modeling/modifying. (just my 2 cents)

@csykes good to hear that as validation. Did you go with Eto for Crash?

From a purely technical point of view, it’s relatively simple to implement:

  1. Spawn a transparent form at the cursor location
  2. Use Drawable to paint all custom elements
  3. Handle mouse down/move/up events
  4. Optionally, use UItimer to animate the whole thing

We are doing this already for Shape. The trickier bit would be to allow users to customize all functionality.

Can you tell us more about UITimer?

Crash is 100% ETO. It’s not great though I need to improve it for sure. But it gives me 0 extra dependencies, is cross platform. :smile:

Thanks Michael, I used such a type of menu with other softwares and I found it very comfortable, easy to be confused but if well structured great instrument :+1:

I created a class. I described the sequence for creation (from circle creation to sector selection) in the GPT chat. and he wrote almost 80% of the code. I only made corrections and additions. So I did everything in 2 days. :sweat_smile:

How do you manage to create an Eto UI with custom control/form outlines? Or, possibly, with transparent form background?

Here is how we create transparent forms on Windows:

void ApplyTransparency(Panel control, System.Windows.Window window)
            {
                control.BackgroundColor = Eto.Drawing.Colors.Transparent;
                window.AllowsTransparency = true;
                window.Background = System.Windows.Media.Brushes.Transparent;
                window.Topmost = true;
                window.ShowActivated = false;
            }


            Eto.Style.Add<Panel>(
                        "transparent", control =>
                        {
                            var wpfWindow = (System.Windows.Window)control.ControlObject;
                            ApplyTransparency(control, wpfWindow);
                        });

You’d then apply the “transparent” style to the form on initialization.

This form hosts a Drawable with a custom shape, so the whole thing appears as if the form had a custom outline.

UITimer is part of Eto.Forms. We use it for animations. Nothing fancy, really. Set the interval quite low, and update the value you are animating in the Elapsed event.

That doesn’t work on Mac does it?

That doesn’t work on Mac does it?

No it doesn’t.
That’s why we really hope Eto can be developed to support the customization of UI controls as well as the possibility of docking the Eto.Forms.Form on the Rhino Viewport! @curtisw

Here’s a short clip of Shape’s widget that @mrhe and I are working on.


full transparency doesn’t work at the moment for macOS. :pensive:

Could you try doing a similar hack as we do with WPF, but with Mono? I don’t have a Mac and can’t test this…

Something like this:

using Eto.Forms;
using Eto.Drawing;
using MonoMac.AppKit; // or using Xamarin.Mac;

void ApplyMacTransparency(Window form)
{
    // This will get the native control object, which should be an NSWindow for macOS
    var nativeWindow = form.ControlObject as NSWindow;

    if (nativeWindow != null)
    {
        nativeWindow.BackgroundColor = NSColor.Clear;
        nativeWindow.IsOpaque = false;
        nativeWindow.AlphaValue = 0.0f;
    }
}

Eto.Style.Add<Window>(
    "transparent", form =>
    {
        ApplyMacTransparency(form);
    });

can’t apply. plugin initialization fails, :pensive: maybe I’m doing something wrong.

public static class StyleSetter2
    {
        public static void SetStyles2()
        {
            Eto.Style.Add<Eto.Forms.Panel>("TransparentPanel", control =>
            {
                var nativeWindow = control.ControlObject as MonoMac.AppKit.NSWindow;
                nativeWindow.BackgroundColor = MonoMac.AppKit.NSColor.Clear;
                nativeWindow.IsOpaque = false;
                nativeWindow.AlphaValue = 0.0f;
            });
        }
    }

Can you debug it? It was untested pseudo code and I have zero experience with the Mac side of things.

I also have no experience with Mac… :sweat_smile:

I have a MacBook pro I can test on I’ll just need to set it up and install Rhino. Probably won’t get to that until Monday

It’s my mistake , when running on the mac., Could not load file or assembly ‘MonoMac, Version=0.0.4.0, Culture=neutral, PublicKeyToken=null’. The system cannot find the file specified.
I am writing with Windows. I installed MonoMaс.Standard to compile the code. this is my mistake. :sweat_smile:

Does it mean that it works and the window is now transparent, or it still doesn’t work and we need to find the root cause?

I’m running a test on a macbook with an M1 arm chip. I think. I need to write code on macOS to test it. I can’t figure out how to write code on Windows to work for macOS…
I also noticed that if you write C# code through nod in Rhino8 macOs on Grasshopper there is no option to connect using MonoMac.AppKit; :thinking: